#!/usr/bin/perl use HTTP::Daemon; use HTTP::Status; my $d = HTTP::Daemon->new( LocalAddr => 'hostname', LocalPort => 8090, ); #$d = HTTP::Daemon->new || die; print "Please contact me at: url, ">\n"; while (my $c = $d->accept) { while (my $r = $c->get_request) { if ($r->method eq 'GET') { my $pathvar = $r->uri->path(); @exact_path = split("/",$pathvar); $c->send_file_response(@exact_path[1]); } else { $c->send_error(RC_FORBIDDEN) } } $c->close; undef($c); }