Find the answer to your Linux question:
Results 1 to 8 of 8
Hi! yall, I dont want to start up a debate here. I am relatively new to linux and was looking to learn either Perl or Python for scripting. I feel ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Nov 2003
    Posts
    3

    Perl vs Python


    Hi! yall,

    I dont want to start up a debate here.
    I am relatively new to linux and was looking to learn either Perl or Python for scripting.

    I feel that if I am investing time learning a language I might as well learn the language that has more general purpose use.

    Any/all comments or suggestions are welcome.
    I would like to know the upside and downside of learning the languages.

    thanks in advance

  2. #2
    Linux Engineer
    Join Date
    Apr 2003
    Location
    Sweden
    Posts
    796
    I recommend you to learn shellscripting and perl-scripting first. Thoose languages you can use on every unix-dialect there is. Then if you think is fun to program you can try python,C or C++.
    Regards

    Andutt

  3. #3
    Just Joined!
    Join Date
    Nov 2003
    Posts
    3
    thanks andutt! I am relatively new to linux not to programming.
    I am a bioinformatician( You must be thinking Bioinformatician who doesnt know perl!! -- well you found an exception) and have done some lisp,scheme , C++ and Java programs. I've used linux primarily via a remote login so never really done any administration.
    To be honest I have done some shell scripting and understand a little of perl. This effort is get linux as my full time os on my laptop( I always dual booted but never too often to linux).

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Engineer
    Join Date
    Jan 2003
    Location
    Lebanon, pa
    Posts
    994
    The only difference is python's syntax is easier to read. Python looks cleaner but they both do the samething. OO on perl was more of a hack where python was built for it so hence it looks a little cleaner.

  6. #5
    Just Joined!
    Join Date
    Nov 2003
    Posts
    3
    thanks guys!

  7. #6
    Just Joined!
    Join Date
    Jan 2004
    Location
    Belize C.A.
    Posts
    10

    Ruby Anyone?

    Hi there,

    well... in the case of the perl vs python issue... hmm... I believe I couldn't judge fairly. This is mainly because I haven't really done any serious programming with perl. However I have used python on many projects, in CGI, GUI and even socket programming. I stronly believe that python is a general purpose scripting language well worthy of attention. Although I do wish that somethings in python weren't really implemented the way they are. But heck, all languages have their pros and cons.

    However, I recently got introduced to another scripting language known as Ruby. Eversince I've been hooked on it. It's usage is fairly similar to that of python, but with a few differences. Honestly speaking, I really like the way Ruby treats a lot of things that I believe Python lacks. For example access specifiers. Probably hardcore python programmers might disagree with me on this, but then again I am so used to the idea of data encapsulation by access specifiers such as those in C++ and Java. I guess it all boils down to a matter of taste.

    Anyway, my bottom line is that if you are familiar with Python, or are willing to learn Python then I recommend giving Ruby a whirl. The learning curve will be minimal. And I can almost guarantee that you'll end up just like me. HOOKED on Ruby!


  8. #7
    Just Joined!
    Join Date
    Nov 2002
    Location
    USA
    Posts
    99
    Perl is a great scripting language. It's probably the most widely used besides shell scripting. Tons of 3rd party add on libraries as well. Python is more object oriented and has a clearer syntax. Also, it uses indenting for separating blocks of code which is different from most other languages where curly brackets {} are the most common. Also, don't think that any one language is the best or will be best suited for all purposes. Think of each language as a different tool in your toolbox. Learn as many languages as you can, you'll be a better programmer, especially as you start to see the strengths and weaknesses of each tool. Since you are just starting out, I'd recommend learning bash shell scripting.

  9. #8
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    The main advantage with Perl is that, just because of its dirty syntax, you can write scripts really quickly. You can do the most amazing stuff with 10 lines or less. That, ladies and gentlemen, is the advantage of Perl.

Posting Permissions

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