Here's your simple example implemented using Mojolicious:
#!perl use Mojolicious::Lite; any '/route_name' => sub { my ( $self ) = @_; $self->render( json => whatever( $self->req->json ) ); }; sub whatever { my ( $request ) = @_; ... } app->start;
Benefits out of the box: strict and warnings enabled by default, doesn't need a third party webserver in front of it, is persistent (will be 100+ times faster than your CGI script - oh "mod_perl" you say? I thought we were all done?), is utf-8 safe, is cleaner, is easier to test, is none blocking, etc, etc, etc.
Saying CGI.pm is simple and that by just writing the code you're all done is to forget the amount of faff required in actually running a cgi script, and then even more faff if you want to do anything slightly more complex and scalable with it.
FWIW CGI.pm is not dead, but i am not accepting any more feature requests for the module, and will not be doing any maintenance except critical bug fixes. Essentially it is "done".
In reply to Re: Is CGI.pm dead?
by leej
in thread Is CGI.pm dead?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |