use HTTP::Daemon; use HTTP::Status; my $d = HTTP::Daemon->new(Listen => 5, LocalAddr => 'localhost', LocalPort => 80, Proto => 'tcp') or die "Can't bind : $@\n"; print "Please contact me at: url, ">\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { if ($r->method eq 'GET') { # dies right on this line $c->send_response("Content-type: text/html\n\nHello World"); } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); } #### use HTTP::Daemon; use HTTP::Status; require 'C:\\rrships\\default.cgi'; my $d = HTTP::Daemon->new(Listen => 5, LocalAddr => 'localhost', LocalPort => 80, Proto => 'tcp') or die "Can't bind : $@\n"; # print "Please contact me at: url, ">\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { # print $r->url->path . "\n"; if ($r->method eq 'GET') { my $response = HTTP::Response->new(200); $response->content(&Hello_World($r->url->path, $r->url->query)); $response->header("Content-Type" => "text/html"); $c->send_response($response); } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); }