That did it. Here's the working code #!/usr/bin/perl -w
use strict;
use CGI qw/:standard/;
use HTTP::Daemon;
use HTTP::Request::AsCGI;
my $d = HTTP::Daemon->new(LocalPort => 8080) || die;
while (my $c = $d->accept) {
my $r = $c->get_request;
my $cgi = HTTP::Request::AsCGI->new($r)->setup;
my $q = CGI->new;
my @names = $q->param;
my $response;
$response = $q->start_html;
foreach my $k (@names) {
my $val = $q->param($k);
$response .= $q->p."key $k = $val";
}
$response .= $q->end_html;
$c->send_response("Content-type: text/html\n\n$response");
$c->close;
undef($c);
}
|