Recently at work, a brief discussion with a co-worker about Perl vs. PHP encouraged me to do some “reading” about the topic.

Honestly, I had never really considered that people were still using Perl on a regular basis for web applications in the year 2007.Â However, my research quickly proved contrary.Â Truthfully, I haven’t touched Perl since I was a freshman in College nearly six years ago, so I suppose I’m a tad out of the loop.

This is what I can say though.Â Perl is powerful, I’ve always known that.Â See… I admit it, I respect Perl.

However, my life as a web developer is easier with PHP (and associated frameworks) than it would be with Perl, at least in my humble opinion.Â In fact, if you consider my recent switch to CakePHP (a powerful & flexible PHP framework), I’d venture to say that I could never get the amount of rapid work, prototyping, and other efforts completed if I was forced to use Perl; no matter how many Perl modules I had access to.

I know it’s not fair of me to say that (since I’m no Perl expert), but still… if you are a die-hard Perl addict, you should take a moment to try PHP for your web applications; and take extra care to try CakePHP.Â I’m betting you’ll be blown away by the time you save and the efficient code you generate.

8 Responses to “Is PHP better than Perl: CakePHP vs. Perl?”

Oh, I KNOW you didn’t just diss Perl…it is the awesomest web language ever! I mean, I design like 50 websites a day, and Perl is way productiver. I can code a page in 1 line. Talk about efficiency! Perl is way older than PHP. And older is wiser. So perl is way wiser than PHP. And Apache sucks, IIS rules. Besides, the Iroquois are much better. They get Mounted Warriors. Of course, the Comanche could best the Apache, in helicopter terms, but why are you bringing that up? We’re talking web design here, and I’m tired of your History Channel shenanigans. Ohhh, Modern Marvels is coming on…

I respect perl for its legacy. But it’s really stalled a lot in the web realm. It’s not even signficantly faster than php apart from startup time (which doesn’t matter in a mod_ or fastcgi situation). The biggest advantage perl has over php is memory footprint. But by the time you write a huge app with lots of cpan modules, that gap narrows. Add a php opcode cache like APC, eaccel, or xcache to the mix, and perl starts to fall behind.

Now python with django looks attractive. Screw ruby on rails — an inferior language to all with an overhyped framework that reminds me of podcast (i.e. mp3s have existed much longer than podcasts just as MVC existed way before rails). Python is a highly respectable scripting language that can do way more than just webdev, is the most performant of the major scripting languages, and django is the MVC framework that gives you all thte same leverage.

In conclusion, if you’re going to look for comparisons to php that actually come out on top, then python is the clear choice. I say this as a veteran php coder with little python experience, not the other way around.

Umm.. actually Perl have their own MVC framework as well. One of the prominent one is called “Catalyst” (http://www.catalystframework.org/). So I guess instead of comparing CakePHP vs Perl.. it might be more relevant to compare CakePHP vs Catalyst.

I however will still stick with PHP, since I’m more comfortable in working around this language compared to Perl. Perl sounds a bit “traditional” to me… no offence to Perl fans

I find that I use perl for more robust applications, often calling up a perl script from my php pages. I do like and use both, though, often finding that one language is easier to use for a specific task. Perl does have CPAN which gives them a leg up for anyone developing anything out of the ordinary.

I use Perl still in 2010 but I’m not reading and writing to databases. I’ve never had much success using dbd, dbi etc.

Having said that for most sites I now use Textpattern but am becoming a little frustrated by some aspects of Textpattern that are not answered by alternative CMSs that I’ve looked at. That’s why I’m considering making the switch to CakePHP. I’ve looked at CodeIgniter but having done a couple of days research on which framework to choose I think I’m going to go with CakePHP.

I find it funny that ‘perl is older and wiser’. With that statement COBOL rules. It’s been around for, well, forever. I’ve used both php & perl. I find php to be easier to use. Especially since you don’t have to worry about how to pass your data types. (array ref, hash , hash ref). You pass an array in PHP it doesn’t care if it’s associative (hash) or not. It treats both the same. For some reason I always seem to get F’d up in perl with passing data types. I usually have to go into debug mode to make sure I’m passing the correct format. In the end both can do what you want. But I believe, at least in web development PHP is better. Background processing I give to perl.