use HTTP::Daemon; use HTTP::Status; my $d = new HTTP::Daemon LocalPort => 9999; print "CDRom webserver running on: ", $d->url, "\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { if ($r->method eq 'GET') { # here you do the stuff # ... } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); }