I despise the PHP language, and I'm quite certain that I'm not alone. But the great thing about PHP is the way that mod_php takes and hides the gory details of integrating with the apache runtime, and achieves CGI-like request isolation and decent performance.
What's the shortest-distance approach to getting the same simplicity, speed and isolation as PHP's runtime environment, with Perl semantics? I feel like raw mod_perl gives me too much rope to hang myself with: cross-request globals, messy config, too many template engines to choose from.
FastCGI? HTML::Mason? I'd like to do development largely in Perl, if only I had a framework that let me.
Look at Catalyst this MVC (model, view, controller) framework works stand-a-lone or with apache_perl and hides a lot of the messy bits. There is a slightly odd learning curve (quick start, slower middle, then it really clicks for advanced stuff).
Catalyst allows you to use Template Toolkit to separate the design logic from the business logic, Template toolkit really is great, even if you decide not to use Catalyst then you should be using this. HTML::Mason isn't something I personally like, although if you do all the HTML yourself then you might want to review Template::Declare which is another alternative you can also use with Catalyst.
For database stuff look at DBIx::Class, which yet again works with Catalyst or on it's own.
I just saw Dancer. Looks like this might be a good option.
The closest, well-regarded equivalent to PHP in Perl is probably HTML::Mason.
Like PHP, it embeds Perl into your document and renders it:
% my $noun = 'World';
Hello <% $noun %>!
How are ya?
The O'Reilly book Embedding Perl in HTML with Mason is available online for free.
I'd recommend Catalyst with FastCGI. Also, for templating, Template::Toolkit is my personal favorite, but HTML::Mason is also highly regarded in the community.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With