On 2/17/07, Jonathan Orlev <[EMAIL PROTECTED]> wrote:

I need to learn some scripting language for mostly, but not only,
administrative tasks and other automation programs.
...
Does it have some advantages over Python? When should I choose Perl over
Python? (language-wize, ignore any "external" issues such as availability,
previous familiarity with the langs, performance, the need to maintain
existing code, etc').

In one sentence: Perl is strong in integration to the OS and text
processing, but kludgy in data structures and APIs.  This is the main
reason sysadmins like Perl above average.

Since non-trivial programs spend most of their code in internal APIs
rather than interfacing to the OS, I think Python is better because it
has lower friction in internal APIs - Perl 5 has many historical
mistakes that you must constantly mind when working with trivial
things like containers , functions and objects...

Perl 6 is *much* better but I don't know whether the existing
implementation of Perl 6 is good enough to use it as your everyday
language.  Probably not ready to be your *only* tool.  Oh, I forgot
Ruby.  It does merge the better parts of Perl's syntax with a clean
design comparable to Python.  I don't know it well but don't decide on
settling with Perl until you checked out Ruby!

Anyway, here is a heretic proposal: start learning 2 languages (3 at
once is probably too confusing).  Start with one week of Python
because it's easiest to learn and one week is enough to become useful.
Than switch to learning Perl for 2-3 weeks or Ruby for 1-2 weeks.  By
then you'll be able to feel which language you enjoy more (which is
the most important condition for productivity) and you'll also have
minimal knowledge of the other language in case you need to
read/modify/write something in it.

--
Beni Cherniavsky <[EMAIL PROTECTED]> (I read email only on weekends)

LUKE: Is Perl better than Python?
YODA: No... no... no.  Quicker, easier, more seductive.
LUKE: But how will I know why Python is better than Perl?
YODA: You will know.  When your code you try to read six months from now.
-- http://www.python.org/doc/Humor.html#yoda :-)

לענות