Skip to content

Instantly share code, notes, and snippets.

@jnareb
Created March 7, 2012 16:26
Show Gist options
  • Save jnareb/1994187 to your computer and use it in GitHub Desktop.
Save jnareb/1994187 to your computer and use it in GitHub Desktop.
running CGI app run_request with PSGI interface
sub to_psgi_app {
require CGI::Emulate::PSGI;
our $CGI = 'CGI';
our $first_request = 1;
my $app = CGI::Emulate::PSGI->handler(sub {
CGI::initialize_globals();
our $cgi = CGI->new();
run_request();
$first_request = 0;
});
return $app;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment