On Saturday 17 February 2007, Jonathan Orlev wrote:
> Hello everybody,
>
>
> I don't have knowledge of Perl nor do I know Python.
>
>
> I have experience with Bash scripting, Windows Batch ("Eichs") and
> VBScript.
>
>
> My question is this:
>
>
> I need to learn some scripting language for mostly, but not only,
> administrative tasks and other automation programs.
>
>
> Perl, Python, (and Ruby?) are the obvious candidates.
>
>
> I think I know what makes Python better than Perl.
>
>
> But what really want to know is this:
>
>
> In what things/aspects does Perl better than Python?
>
>
> 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').
>

Well, I'll bite.

First of all let me introduce myself. My name is Shlomi Fish ( 
http://www.shlomifish.org/ ) and I've been writing a lot of Perl since 1996. 
I've been dabblign with Python for some time but not as seriously as Perl, 
and only when I started working on a codebase that was required to be 
Pythonic or was otherwise already written in Python.

Now I started the Python activities here in Israel rolling, because I wanted 
the Israeli Pythoneers to be more active, I've been coming to Python 
meetings, and been involved in the maintenance of the site and the Wiki.

All that aside, here are some advantages I see to Perl over Python:

1. CPAN - http://www.cpan.org/, http://search.cpan.org/ - Comprehensive Perl 
Archive Network. Many Perl modules that can be used or glued together to 
perform many common tasks. Easily installable using a unified interface, and 
anyone can register and contribute his own. Currently there are 11,200 such 
modules and the number is constantly growing.

Using CPAN modules can often save you a lot of work.

The various APIs for Python are much more scattered around the Net. I was told 
the Python people have started an effort similar to CPAN, but when I was told 
about that, I was told some functionality was still missing.

2. In Perl anonyomus functions can span more than one line and several 
statements. This allows writing sophisticated callbacks much more easily than 
Python's "lambda" which is restricted to one expression.

3. Perl has a richer syntax than Python and a "There's More than One Way to do 
it" Philosophy. As a result, one can express himself in Perl, similar to the 
fact that one can express himself in a rich human language such as English. 
Of course, this is also a disadvantage because reading other people's code 
(especially of those that are very experienced) is much harder.

-------------

I'm afraid I can't think of anything else right now. Note that my general 
advice is that one should learn both Perl *and* Python, as they are both 
useful, enlightening, and important to learn.

Regards,

        Shlomi Fish

---------------------------------------------------------------------
Shlomi Fish      [EMAIL PROTECTED]
Homepage:        http://www.shlomifish.org/

Chuck Norris wrote a complete Perl 6 implementation in a day but then
destroyed all evidence with his bare hands, so no one will know his secrets.

לענות