What are some of the payoffs? Can you (or anybody, really) give specific examples as to what the benefits of using Perl as CGI as a replacement for PHP would be? Where is the "break even point" for when a project becomes worth doing in Perl?
Re^2: From PHP to Perl - Should I, and how?
Replies are listed 'Best First'.
The break-even point will vary among programmers. It will even for one programmer over time as you gain familiarity with both languages and the best practices for using both languages.
My rule of thumb these days for choosing between PHP and Perl is that if I find a well-designed, secure, fully functional open source project written in PHP for which there is no Perl equivalent, I'll customize the PHP project. If the available starting points are equivalent or I'm writing from scratch in either language, I always choose Perl over PHP. I learned Perl first and then PHP specifically to leverage existing code, so perhaps that has something to do with it.
I also use C, bash, Pascal, Forth, various forms of Basic, or Lisp for maintaining programs already written in those.
I sometimes use C, Forth, or Lisp just to keep my hand in and teach myself more about programming with them, as I don't use them very often. Those skills are too handy to let atrophy.
You can start with a requirement to do almost anything at all and find CPAN modules which do it.
(Including, by the way, CGI authentication and passwords...)
And throughout it all... TMTOWTDI.
The problem with “there's only one way to do it” is that, eventually, you will bang into that.
No matter how good “that one way” might be, nor to how many people, if you do run into a limitation, you won't be able to fix the problem within that language.
Try this link: Catalyst. On the one hand, yes, “Catalyst is a web framework.” But on the other hand, you are looking at a list of (today) 906 links, and all of them are “real.” You say that you'd like to incorporate XML RPC-calls neatly into your app? It's there. Oh... you say you don't prefer Catalyst? Try: CGI::Application or Mojo or Jifty or ... ...
Notice: you are still in Perl. So, whether your favorite pasttime is “a web application” or sub-orbital flight paths, or maybe just a rocket-baby, you haven't left Perl.
When I said, “Catalyst has 906 other modules associated with it,” I did not mean that “you should install them all!” :-D
“Whoa, there! Slow down, pardner! Whoa!”
What I meant by this comment is: just within the auspices of “the Catalyst, for example, framework, there are more than 900 modules that you can employ in your application without having to write any of them.”
What you should do is... “stop and look around.” Don't try right-away to do anything. Instead, browse through the listing just to get an idea of what's out there. The web-site for Catalyst is http://www.catalystframework.org.
And this is only the tip of the iceberg of what you should spend a day or two prowling through.
The website http://search.cpan.org is also very helpful. CPAN is the principal library of contributed code for Perl. If you type-in the search term "AJAX," you'll see that there are (currently) 146 modules associated with that. So... am I telling you to “install all of those?” Again, no. What I would suggest that you do, to start with, is to simply browse through that list...
“Don't try to understand ’em ... just rope and throw and brand ’em ...”
“So... install that?” No, just look around.
Your instincts to “just dive in” might be going-off just a little bit too early here. This language is so vast, compared to PHP, that you'll be floating fairly quickly.
Look before you leap, and your initial forays into Perl will thereby be much more satisfying and fruitful.
Your time will be better spent than otherwise it is likely to be.
The top benefits for me are modules. The template modules along with the CGI modules (and all the other various ones for databases, servers, etc.) are a huge pay off. That's not really a specific answer, though (sorry).
The "break even point" is hard to estimate. It will be higher for you than it is me due your larger knowledge of PHP and lesser knowledge of Perl. A site for a small business might be better off written in PHP because of it's availability and ease-of-use. The gaming site that you wish to someday create might be better off written in Perl because it is easier to divide the code and faster to write because the hard parts are written for you (see: modules). (I do not want to be specific here due to possible counter-arguments that will be pointlessly accumulated in your node.)