use HTTP::Daemon; use HTTP::Status; use CGI qw/:standard/; my $d = HTTP::Daemon->new(LocalPort => 8080) || die; while (my $c = $d->accept) { while (my $r = $c->get_request) { my $uri = $r->uri; $ENV{REQUEST_METHOD} = $r->method; $ENV{CONTENT_TYPE} = join('; ', $r->content_type); $ENV{CONTENT_LENGTH} = $r->content_length || ''; $ENV{SCRIPT_NAME} = $uri->path || 1; $ENV{QUERY_STRING} = $uri->query || ''; my $q = new CGI; my $p = $q->param('foo'); my $reply = $q->header.$q->start_html."the foo parameter is $p +<p>".$q->end_html; $c->send_response($reply) } $c->close; undef($c); }
In reply to Re^2: Using HTTP::Daemon with CGI
by cormanaz
in thread Using HTTP::Daemon with CGI
by cormanaz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |