Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Remove CGI.pm from Perl Core? (Plack / PSGI Stand-Alone)

by Corion (Patriarch)
on May 28, 2013 at 13:57 UTC ( [id://1035613]=note: print w/replies, xml ) Need Help??


in reply to Remove CGI.pm from Perl Core?

Tatsuhiko Miyagawa and Johan Vromans point out a very nice approach to creating a Plack stand-alone executable on p5p:

% cat > app.cgi package main; my $app = sub { return [ 200, [ "Content-Type", "text/html" ], [ "Hello" ] ]; }; Plack::Handler::CGI->new->run($app); % cat `perldoc -l Plack::Handler::CGI` app.cgi > app_bundled.cgi

... or, creating a Mojolicious::Lite app:

$ cat > myapp.pl use Mojolicious::Lite; get '/' => sub { my $self = shift; $self->render(text => "Hi"); }; app->start;
The myapp.pl can work as a CGI, but also as a PSGI handler if you deploy to platforms that only supports PSGI apps and *not* CGI, such as Heroku, DotCloud and Stackato.

Replies are listed 'Best First'.
Re^2: Remove CGI.pm from Perl Core? (Plack / PSGI Stand-Alone)
by Anonymous Monk on May 28, 2013 at 18:58 UTC

    % cat `perldoc -l Plack::Handler::CGI` app.cgi > app_bundled.cgi

    Why not use fatpacker if you've got linux where fatpacker works ?

    OTOH that won't work as Plack::Handler::CGI has pod in __END__ section, so app.cgi is in __END__ section, so there is no app

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1035613]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-25 22:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found