Embedded Perl Solutions As CGI Substitute?
broken77 asks: "At the company I'm working for now, we're starting a new project, and at the same time are looking to find some kind of "standard" method of making our CGI-like perl programs. CGI.pm and cgi-lib.pl have been used in the past, but we're investigating some kind of embedded perl solution similar to ASP or PHP. I should mention that Unix-ASP and PHP are not options (I don't really need to go into the reasons). Also, Perl is definitely the language we will be using. We're looking mainly at ePerl, HTML::Embperl and PerlMagic Lightning. Does anyone have experience with any or all of these? Are there some benchmarks I can find? Are there any products that you've found to be better than these three that I've listed?"
Nice mention... WARNING though - the AxKit web site is horribly down today due to a complete internals overhaul of AxKit. Unfortunately the box is both the AxKit devel box, the AxKit web server and my personal workstation... Expect it back online later today.
Matt. Want XML + Apache + Stylesheets? Get AxKit.
Subject says it all...
Matt. Want XML + Apache + Stylesheets? Get AxKit.
Yes, I use this and it's great. It provides many features above and beyond "code inside you HTML" model. These include a coherent (now OO based) component structure, data caching, page templating, a previewer, and even a content management system a la Zope (although I haven't used this myself, and I think it's still experimental). These feature definitely put it towards the top of the pile. If more service providers gave this as an options I'd never touch PHP again, version 4 or no. And don't be put off by the sub-1.0 version, it's being used in a lot of production systems already, including where I work. You can find out more at Mason HQ.
My suggestion is to write as much as you can in .pm modules (perl objects if you're really looking for maintainability) and then just do loops and stuff in your templating language. That way, you can easily write command-line interfaces to the same functions you're calling from your HTML pages...which makes testing MUCH easier and faster.
As for speed...mod_perl has eliminated perl as the bottle neck for most requests for us...database queries are much slower than the a reasonable perl function, so you can ignore anyone who says that perl is too slow for dynamic, high traffic stuff.