Skip to content

Instantly share code, notes, and snippets.

@miyagawa
Created April 10, 2009 19:03
Show Gist options
  • Save miyagawa/93231 to your computer and use it in GitHub Desktop.
Save miyagawa/93231 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
my $script = shift or die "script required";
MyWebServer::CGI->new->run;
package MyWebServer::CGI;
use base qw( HTTP::Server::Simple::CGI );
sub handle_request {
my $self = shift;
my $cgi = shift;
CGI::nph(1);
local *CGI::new = sub { $cgi };
do $script;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment