Well said, perl might be the theoretically best match in specifically this problem domain but the thing is there are only so many programming languages one can learn.
If i had to choose only one of ruby/python or perl i would choose the former and it would be able to cover my base both as glue-code and for more programs. Perl would maybe make the glue code a bit easier but instead i would be much less employable and have a much harder time finding other people who can read the glue. I'm not qualified to have an opinion on perls capabilities for other programs but i'm sure there are valid reasons most people prefer other alternatives.
I still find Perl is better for some tasks (over Python - I don't know Ruby). It has loads of syntactic sugar such as globbing files, backticks for executing system calls.
I agree that there is no reason to switch between Perl/Python/Ruby. They are all the same language with slightly different punctuation.
I think Perl has better libraries, but learning those and discarding your experience with one of the other languages is probably not much of a net gain.
I would argue that ruby as almost all the strengths of perl and conciseness with more coherency if you want a perl-like fluidity and terseness. I personally like python for anything that becomes more than a 100 lines of bash.
So I consider Perl to not be a best choice for occasional use: I always had to re-learn the syntax and decipher my old code - something I didn't have problem with in other languages.
To sum it up, Perl is a great language, but requires a lot of dedication like C++ does. So the eternal question still remains - Perl, Ruby or Python? ;-)
Perl is a deep language. No one will argue that's not true. But it is entirely possible to write Perl code in a very Pythonic style, if that's what floats your boat. Perl objects are actually a lot like Python objects. But, if you do that, you're stuck using only the features that Python would give you...which most experienced Perl mongers are unwilling to do. (I'm aware there are a few interesting Python features that Perl lacks, or if not lacks, at least require a slightly more verbose implementation in Perl.)
I learned dynamic language programming with Perl about 10 years ago, and worked in it for a few years. Then I worked in Python predominantly for a while...with some of the best Python developers in the world (if you use Python, you use code daily that a couple of them wrote), and found it a great language. In fact, during those three or four years I decided that Python was a better language than Perl. But, a funny thing happened, I found myself working full-time with Perl again about three years ago...and I decided that I should learn it properly this time rather than banging my way through based on what I could glean from examples of questionable heritage on the web.
It turns out, I was wrong. Perl is a better language (for me) than Python. They're both very fine languages, of course, but there are some things about Perl that really make me happy. Unicode in Perl is so natural it's like magic, for example. Not so in Python, where you have to ask explicitly for Unicode strings--you can actually write Perl code in Unicode, if you're feeling freaky like that. Regexes are first class entities in Perl...a regex can be an object, can be made into a reference, etc. which is incredibly powerful once you're accustomed to it. Backward compatibility is astoundingly good in Perl. We have code that hasn't been touched in 10 years that still runs on Perl 5.10. It may be ugly and old, but it works fine...the cheapest code to maintain is that which requires no maintenance. When I worked in Python, I had to make changes to almost everything between several major revisions: 1.5 to 2.0, in particular, but the 2.x releases also always required minor code changes.
There are a few things I miss from Python, but the "cleanliness" of Python is not among them. Modern Perl is extremely nice to read. What I do miss is a good REPL (though mst's Devel::REPL is coming along nicely, it's still no iPython).
Ruby also seems pretty awesome. I certainly found it very intuitive when I spent a week or so messing with it. But many of the things I really loved came from Perl. I do have to say that it always felt like I wrote fewer bugs into my code when working Ruby than Perl or Python (which always seemed about equal, to me). I dunno why that is, exactly.
I've been playing around with perl over the last 10 years, and over the last 4 years or so doing perl professionally.
Because I'm in the job market at the moment I figured I'd take a closer look at Python and Ruby, so I'm concurrently reading two python/ruby books. To be honest, I don't see much in it. If I were to chose one I think I'd have to go with python, because Ruby looks to me, just like perl but with a different set of weird symbols to remember, and a slightly different set of downsides.
Python on the other hand looks like a sufficiently different take on the dynamic language problem, so as to be more interesting.
PHP I'm not bothering with right now. It's just like perl only with most, if not all of the design intelligence removed.
As someone who strongly dislikes perl (I'm being generous there really), I really don't think python or ruby do a better job at all. Python's selling point seems to just be "the syntax is different", and I honestly can't tell how ruby is supposed to be better than perl at all. It is barely even different.
Ruby is a better Perl; it's closer to Perl than e.g. Python, it has fewer footguns but is also very expressive. It also has alternative quotes, backtick, shellescape etc. for ad hoc shell integration though you're better off learning IO.popen and others to take the shell out of the equation.
People say don't use Ruby because of the small community outside of the web and others say don't use Perl because it's "old." I don't really like the syntax or Python that much(I know I know). Which would be the best choice for simple scripts, and to eventually move on to bigger projects.
For me, learning Ruby after years of knowing Perl was a resounding "meh." The documentation is substandard compared to Perl's and it doesn't really offer anything that Perl does except for less weirdness in the nooks and crannies and some improved syntactic sugar in some cases (though when I look at Ruby code all I see is "end end end end end").
And Python certainly has its own feel. But again it's not really any more powerful than Perl and offers nothing but an alternate simplified syntax. Programming in Python makes me really miss Perl--I always feel like I'm speaking baby talk instead of full blown English. Really elegant baby talk, but baby talk none the less.
Perl fits in fine in terms of usage, and can do everything that you can do in the other two, and probably more. It's the employability of perl hackers vs python and Ruby programmers that suffers.
I am a perl dev for almost 3 years and i learned it at my job after i tried ruby and python.
For more than a year i felt i should have chosen ruby because of how intuitive it feels: you read the code always from left to right, whereas in perl you often either go from right to left or from the center of the line outward. Besides that, fuby also has that principle of less surprise.
However, after I got accustomed with perl, i started to love its expressiveness and flexibility. And now, I almost got to love the "there's more than one way to do it" mantra. Regarding Python, I see it more close to Perl from a readingness perspective, but with much less flexibility embedded.
Choosing a language for a project rarely comes down to researching the languages that may best deal with the problem. More often than not from my experience, it’s what the first engineer(s) on the project thought would be fun (annoyingly often in the case of using new languages in production), were most-familiar in, or the company is most familiar with, or because some library they need to use is only available in X language and it would take too long to do the project and implement the library in their “normal” language.
Perl, Python, and Ruby are all pretty competent and on the same level. Given that Perl is chosen as a language the question isn’t “Justify the use of Perl to the exclusion of Python and Ruby.” It’s “What can Python or Ruby do that Perl can’t?”
Some common arguments between Python and Perl can be found at http://coosoft.wordpress.com/2013/02/24/the-perl-vs-python-d... (I would add the author should have expanded on Object Oriented in Perl more. While native OO in Perl is exceptionally basic, third party OO frameworks for the language exist such as Moose and Moo complete with introspection, roles, type constraint, triggers, attributes, etc, etc).
Perl is a powerful modern language, actively developed by a committed community[1]. We’re just generally too busy doing things to blog about all the awesome stuff as much, so people’s perceptions of the language are often stuck in 1998.
If i had to choose only one of ruby/python or perl i would choose the former and it would be able to cover my base both as glue-code and for more programs. Perl would maybe make the glue code a bit easier but instead i would be much less employable and have a much harder time finding other people who can read the glue. I'm not qualified to have an opinion on perls capabilities for other programs but i'm sure there are valid reasons most people prefer other alternatives.
reply