I use Perl almost exclusively. CPAN is my one word argument. Aside from that, though, Perl can become whatever you make it. Want Ruby-like method calls on literals? Use autobox. Want list comprehensions? Map/grep. Want to rip apart language built-ins at runtime, tie data sources to filehandles, or just use it for one-liner awk replacement? Done.
Python and Ruby are sexy but they both feel like subsets of Perl to me.
An honest question: are there any reasons to learn Perl these days (as opposed to Ruby/Python/name your favorite scripting language)? Some people need to maintain existing Perl codebases for sure, but they should know Perl already?
I would hazard a guess (with nothing really to back me up other than a quick google search and my memory of the data I have seen presented on this subject in the past) that perl has a slight performance edge (cpu and memory) over python and more so over ruby. That isn't a great argument though, since they are all in roughly the same performance class.
I think the main difference between those three languages is cultural, rather than technical.
So to answer your question I guess I'd say: "Because you find the perl culture and community (and it's technical mores - such as it's approach to testing, documentation) more to your taste than the other languages". Basically if you prefer "TIMTOWTDI" to "pythonic".
But practically speaking, given the similarity between them, I'd guess you're likely to stick with the first of those you learn thoroughly, unless you change job or are swayed by "Perl is dead!/Perl is ugly!", "Ruby is slow!/Monkey patching is evil!" or "Whitespace-sensitivity is bad!/Broken lexical scoping is broken!" or whatever other clarion call washes through various blogs.
Personally, I really like the partial static checking perl does with strict mode on and I feel a little horrified that python doesn't provide that safety net (I don't know if Ruby does).
We started a new project a year or two ago and evaluated using Perl,Python Ruby and the main factor in the reason to use Perl was that the libraries for our particular usage cases where better in Perl than the others at that time. For LDAP and SNMP in particular there exists Pure Perl Libraries that are very mature, at the time similar libraries for Ruby and Python where just wrappers around C classes and not as mature (Might be different now).
Java might have been a good choice in this regard as well but our team was used to using Dynamic languages.
I would suggest that anyone looking at a particular language should consider what they want to achieve and then investigate the existing libraries etc to complete that task.
Having committed to using Perl we have had no regrets things like Moose and roles IMHO put it on par with Languages like Python and Ruby.
Edit: Formatting
Perl probably creates about 75% of my income. That's working on current modern projects. Mostly we don't have to do too much wheel-reinvention because of CPAN. Yes it's worth learning perl.
[+] [-] gatlin|14 years ago|reply
Python and Ruby are sexy but they both feel like subsets of Perl to me.
[+] [-] vtail|14 years ago|reply
[+] [-] jbert|14 years ago|reply
I would hazard a guess (with nothing really to back me up other than a quick google search and my memory of the data I have seen presented on this subject in the past) that perl has a slight performance edge (cpu and memory) over python and more so over ruby. That isn't a great argument though, since they are all in roughly the same performance class.
I think the main difference between those three languages is cultural, rather than technical.
So to answer your question I guess I'd say: "Because you find the perl culture and community (and it's technical mores - such as it's approach to testing, documentation) more to your taste than the other languages". Basically if you prefer "TIMTOWTDI" to "pythonic".
But practically speaking, given the similarity between them, I'd guess you're likely to stick with the first of those you learn thoroughly, unless you change job or are swayed by "Perl is dead!/Perl is ugly!", "Ruby is slow!/Monkey patching is evil!" or "Whitespace-sensitivity is bad!/Broken lexical scoping is broken!" or whatever other clarion call washes through various blogs.
Personally, I really like the partial static checking perl does with strict mode on and I feel a little horrified that python doesn't provide that safety net (I don't know if Ruby does).
[+] [-] code4pay|14 years ago|reply
Java might have been a good choice in this regard as well but our team was used to using Dynamic languages.
I would suggest that anyone looking at a particular language should consider what they want to achieve and then investigate the existing libraries etc to complete that task.
Having committed to using Perl we have had no regrets things like Moose and roles IMHO put it on par with Languages like Python and Ruby. Edit: Formatting
[+] [-] singingfish|14 years ago|reply