On 2/18/07, Beni Cherniavsky <[EMAIL PROTECTED]> wrote:
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...
I'll second the above. I will also mention that Perl code is hard to understand and maintain (doubly so when the maintainer is not the original author). Python was made to be readable, and is therefore much easier to maintain. This is very important IMO since you learn mostly by reading other's code, and this is much more difficult with Perl. In other words, from my experience - Perl is like hardcore hacking, while Python is like writing poetry. - Tal