Find the answer to your Linux question:
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.
  1. #1
    Linux Engineer Javasnob's Avatar
    Join Date
    Jul 2005
    Location
    Wisconsin
    Posts
    942

    Scripting Languages


    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?

  2. #2
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    It's a real matter of choice and personal preference. Is there anything you want to script, but can't do in Perl?

  3. #3
    Just Joined!
    Join Date
    Nov 2005
    Location
    Chicago, IL
    Posts
    46
    Automation is automation but I have seen some pretty involved Expect scripts (Tcl/Tk).
    http://expect.nist.gov/
    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.

  4. #4
    Linux Enthusiast
    Join Date
    Aug 2005
    Location
    Hell
    Posts
    514
    Virtually all tools and features that you can think of using (and many random ones you won't) are available as Perl modules on CPAN. There are thousands of them.

  5. #5
    Linux Guru lakerdonald's Avatar
    Join Date
    Jun 2004
    Location
    St. Petersburg, FL
    Posts
    5,035
    Now that looks neat.

  6. #6
    Linux Newbie GNOME_n00b's Avatar
    Join Date
    May 2005
    Location
    UK
    Posts
    142
    Quote Originally Posted by Javasnob
    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?
    yes, python et al are readable...unlike perl. if you want to do short scripts, perl may be the better choice for you seeing as you already know it. if you want to write an application of reasonable size, don't torture yourself by using perl....especially when it comes to debugging.

  7. #7
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •