Re:Perl is 26 Today
by rikacomet on Thursday December 19, 2013 @07:23AM
(#6934207)
Might I ask, in a nutshell.. why not CGI?
[ Parent
| on HN ]
Re:Perl is 26 Today
by untothebreach on Thursday December 19, 2013 @07:33AM
(#6934251)
(classic) CGI requires a full application start-up every time a request comes in, and so is very slow. If you have to use CGI, use FCGI (fast cgi) to solve that problem.
However, in recent years PSGI has started to become the standand in the community. As far as I know, it is modeled after Python's WSGI. All of the "major" perl web frameworks support it, the three big ones I can think of are Mojolicious[1], Dancer[2], and Catalyst[3].
1: https://metacpan.org/pod/Mojolicious
I will look into these, thanks! I knew about FCGI, but didn't knew about PSGI. Much appreciated.
Re:Perl is 26 Today
by untothebreach on Thursday December 19, 2013 @08:37AM
(#6934532)
I probably should have included this link too: the PSGI spec itself (https://metacpan.org/pod/release/MIYAGAWA/PSGI-1.102/PSGI.po...)
There is Dancer2 as well
https://metacpan.org/pod/Dancer2
Dancer2 is also great for creating a web service, of sorts. Need something to send out JSON chunks with a URL front-end? Very simple to set up and get going. I've been translating some code I wrote for web pages into little engines for Dancer2 to run for other groups inside the company to extract information out for their own applications. It's perfect for that.
Re:Perl is 26 Today
by arc_of_descent on Thursday December 19, 2013 @09:03AM
(#6934662)
CGI::Application too supports PSGI via CGI::Application::PSGI. I prefer CGI::Application as it is minimalist and very customizable.
Re:Perl is 26 Today
by liveoneggs on Thursday December 19, 2013 @09:34AM
(#6934823)
you can deploy mojolicious as cgi. :)
It's really nice, though. Try out Mojolicious::Lite asap!