Earlier quoted context omitted.
> while (my $req = CGI::Fast->new) { myApp->run($req); } > Is there a handler/wrapper for that? Assuming that while loop is in your bootstrap FastCGI script, you can instead have an app.psgi (or whatever named) file with the content: use CGI::PSGI; my $app = sub { my $req = CGI::PSGI->new(shift); myApp->run_psgi($req) }; Now your new `run_psgi()` method should return the [ $status, $headers, $body ] array reference,…
I've read the entire advent for plack and started to port my app. - Why send back an array ref instead of using the CGI way? What is the advantage it brings? If I want my app to run in a simple FastCGI environment (with the CGI protocol), this will not be possible anymore so I will be dependent on the Plack suite or create 2 versions: PSCI enabled and not PSGI enabled (this will not be much but still, 2 is worst than…
If you design a fibonacci() function, would you make it print the result to STDOUT, or return the result as a return value?
If the specification is to print to STDOUT, a web server needs to make a trick to capture the output using tie, PerlIO or anything else, just like FCGI.pm does, and that's inefficient.
> - Are all the $ENV variables available? (SCRIPT_NAME for example?)
http://search.cpan.org/~miyagawa/PSGI-1.03/PSGI.pod#The_Envi...
> I don't really see what advantages it will bring to framework like Mojolicious for example (they will certainly never ever used any Middleware stuff from the Plack namespace as this is at the heart of their policy
See this post by the Mojolicious author, how to use Plack middleware for ANY Mojolicious based apps http://blog.kraih.com/mojolicious-and-plack
Also for Dancer: http://advent.perldancer.org/2010/22