);
sub handle_request {
my ( $self, $cgi ) = @_;
print "HTTP/1.0 200 OK\r\n"; # probably OK by now
print "Content-Type: text/html\r\nContent-Length: ", length($default_doc),
"\r\n\r\n", $default_doc;
}
=head2 handler
Handler implemented as part of HTTP::Server::Simple API
=cut
sub handler {
my $self = shift;
my $cgi;
$cgi = $self->cgi_class->new;
eval { $self->handle_request($cgi) };
if ($@) {
my $error = $@;
warn $error;
}
}
1;
__DATA__
Hello!
Congratulations!
You now have a functional HTTP::Server::Simple::CGI running.
(If you're seeing this page, it means you haven't subclassed
HTTP::Server::Simple::CGI, which you'll need to do to make it
useful.)