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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Is CGI.pm dead?
by Corion (Patriarch) on May 26, 2015 at 11:18 UTC | |
by Anonymous Monk on May 26, 2015 at 21:54 UTC | |
|
Re: Is CGI.pm dead?
by Discipulus (Canon) on May 27, 2015 at 08:15 UTC | |
|
Re: Is CGI.pm dead?
by leej (Monk) on May 28, 2015 at 13:41 UTC | |
by Anonymous Monk on May 28, 2015 at 14:29 UTC | |
by leej (Monk) on May 29, 2015 at 14:47 UTC | |
by Anonymous Monk on May 30, 2015 at 08:12 UTC | |
by leej (Monk) on Jun 01, 2015 at 08:40 UTC | |
|
Re: Is CGI.pm dead?
by dsheroh (Monsignor) on May 27, 2015 at 07:24 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |