Hacker News new | comments | show | ask | jobs | submit login

Are there really any compelling reasons to use Perl over Ruby for greenfield projects (i.e. not legacy maintenance)? I've written maybe a dozen medium-length Perl scripts (but nothing very large) before I got into Ruby, and I can't seem to think of anything that Perl does that can't be done at least as well in Ruby.

Honestly not trying to start a religious war here - just curious - and I think it's fair to compare the two languages as they are both runtime interpreted and have relatively similar characteristics (and obviously Ruby took a good dose of inspiration from Perl, anyway).

The reasons I would cite: the Ruby development community leaves a lot to be desired from a sysadmin's perspective. We went through similar pains with Perl, but they're mostly a decade or two behind us. With Ruby, there are multiple concurrently maintained trees, it's hard to sort which one should be "primary" on a system, and you have to do a lot of serious grokkage to understand that RVM isn't really intended for maintaining system Ruby installs, but a local per-user developer instance. Which, when what you've got Ruby for is managing chef, is a more than slightly whack.

http://www.lucas-nussbaum.net/blog/?p=617 http://www.lucas-nussbaum.net/blog/?p=681 http://news.ycombinator.com/item?id=2059964

Much of Perl's use is by sysadmins, which means it plays well in their space. By contrast, much of Ruby's use is by web developers, many of them on bastardized MacOS systems (they're born bastards, it's not the developers' fault ;-). Which means that Ruby's packaging is whack.

I don't hack much of either, though work around both. The nice thing about Perl from my perspective is:

1. It's included with the system. I run Debian/Ubuntu boxes if I can possibly help it, Perl is of of the tools used to write a whole slew of system scripts, and as a consequence, it's very well managed within the distro. Red Hat/CentOS aren't far behind.

2. CPAN plays nice. Under Debian, your CPAN bundles are installed to /usr/local/ Debian's just sorting out where to store Ruby gems.

Thanks to chromatic for mentioning perlbrew. I've encountered RVM in the past month or so and have been trying to wrap my head around it. Understanding RVM in terms of perlbrew helps a lot: http://ithaca.arpinum.org/2010/06/13/rvm-and-perlbrew.html

Are there really any compelling reasons to use Perl over Ruby for greenfield projects....

That's exactly what I'm doing. Reliability is only one reason I chose Perl over Ruby, but upgrading three real-world applications my business relies with their dependencies on to a new major release of Perl 5 in an afternoon while doing other things and only having to intervene three times is a tremendous boon.

Upgrading from Ruby 1.9.2 to 1.9.3 wasn't that easy.

It depends on your infrastructure. Some setups just don't have an infrastructure setup to make the transition easy.

For me, personally, these are some of the reasons:

* I've had more years of Perl than I have of Ruby. While there's not a massive difference it comes a bit easier to my fingers and brain.

* The testing framework is better - it's much easier to integrate different styles of testing and integrate tests running in other languages

* I can usually get more people to do my work for me with CPAN than I can with rubygems

* Moose has some interestingly different ways of breaking up abstractions (Moose is the de facto way of doing OO in Perl now. Moose is to Perl as CLOS is to Lisp)

You're probably not going to be suddenly more productive if you switched to Perl - but there are some plus points. As does Ruby of course.

Swings or roundabouts. Your choice :-)

I'm a Perl weenie through and through, and I ask myself this every time I start a new project, because I know one reason I turn to Perl each time is because I am /fluent/. Hiring Perl developers is hard, Perl has some ugly bits, and it's far from 'cool', however:

DBIx::Class, Moose, Catalyst, Template Toolkit - these are a joy to work with. People seem to be just ok that they have Rails, bitch about Active Record, and honestly, just don't seem to love their tools.

TAP-based testing is awesome sauce. Ruby gets this so wrong with all tools checking return values of scripts + the occasional hacked together jUnit outputter. Even the testing tools stolen from Ruby (like Test::BDD::Cucumber (which I may have written)) use TAP and Perl's testing tools all the way down.

Finally: there's CPAN. It Just Works. I started off a Perl dev, and use of any other language's package system has just made me sad face.

Here's another reason: If you are doing work you know you are likely to port to C at some point.

I don't follow?

(and I'm saying this as somebody who love's Perl - I'm not seeing the connection)

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact