Results 1 to 7 of 7
I was just wondering...since I already know Perl, should I even bother learning languages like Python and Tcl/Tk? Is there anything they have that Perl doesn't?...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-12-2006 #1
- 01-12-2006 #2
It's a real matter of choice and personal preference. Is there anything you want to script, but can't do in Perl?
- 01-12-2006 #3
- Join Date
- Nov 2005
- Chicago, IL
Automation is automation but I have seen some pretty involved Expect scripts (Tcl/Tk).
And it is compatible with both UNIX/Linux and Windows Systems (much like Perl is now). It would only be an extra thing to add to your resume.
Here is a brief summary I pulled off of the Expect FAQ:
Expect is a tool primarily for automating interactive applications such as telnet, ftp, passwd, fsck, rlogin, tip, etc. Expect really makes this stuff trivial. Expect is also useful for testing these same applications.
- 01-13-2006 #4
- Join Date
- Aug 2005
- 01-13-2006 #5
Now that looks neat.
- 01-13-2006 #6Originally Posted by Javasnob
- 01-13-2006 #7
- Join Date
- Oct 2001
- Täby, Sweden
As always, one should use the right language for the job at hand. Python focuses at certain things Perl doesn't, and Perl focuses at certain things Python doesn't. For any given job, it is almost certainly doable in both, but preferrably done in one.
In general, if something involves even a slight bit a line-oriented string manipulation, I'd say one would be a fool not to use Perl. On the other, if you want to juggle data structures a lot, Python is probably the better choice of the two (although I'd argue that Scheme or any other dialect of LISP beats it in many points). One nice thing about Python is that (as far as I have been told, I haven't done it myself) it is fairly to write Python modules in C, and therefore there is quite an amount of common libraries with Python interfaces.
As for Tcl, I say forget it. I'll admit I don't know it that very well, but from what I've been able to tell, it doesn't have very many redeeming features if you compare it to virtually any other scripting language.
Personally, I actually only got started with Python less than a month ago. I was long boycotting it for its practice of forcing an indendation style on the poor programmer (which I still despise), but then I thought I would at least try it, and it was much nicer than I had expected. It has some really nice tricks to juggle around with different data structures, such as list comprehension, generic iterables, a very good `for' command and convenient short-hand syntax for things like lookup and concatenation. It also offers a "set" data structure (in the mathematical sense) with arithmetic constructs for union, intersection, difference and symmetric difference. I found that I could easily write a DNS implementation, including a server and a recursive resolver in just a few days, which is still less than 1500 lines! The core protocol implementation is just above 600 lines, and I completed it in only a few hours of active work. I'd call that pretty amazing. Except the indendation stuff, the only really bad thing about Python that I've found so far is its thread implementation (there's no way to interrupt a thread!), which is causing me some major problems.
Last edited by Dolda2000; 01-13-2006 at 11:04 PM.