Hello, I've found out that CGI.pm is no more in the core distribution of Perl. I've also read that there are many better ways to implement a web application, like use Plack, or use CGI::Application, CGI::Snapp, Dancer, Mojolicious... It is also suggested to use templating systems (ok fine, I've used them with CGI.pm).
However, with modern responsive websites I think that CGI.pm is still a great module, so simple to use it that I don't see a reason to move away or use anything else.
You just write an API for the client javascript making an AJAX request and you're all done with something like:
#!/usr/bin/perl use strict; use CGI; use JSON; my $query = new CGI; my $response = whatever(Query=>$query); my $json = JSON->new->utf8(1)->pretty(1)->allow_nonref->encode($respon +se); print $query->header('application/json').$json; sub whatever { # Here you can do REALLY anything, and send back an hash reference }
Do I make it too easy? This is has a flat learning curve too.
In reply to Is CGI.pm dead? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |