Created
April 10, 2009 19:03
-
-
Save miyagawa/93231 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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