in reply to Simple script serving as httpd

Try HTTP::Server::Simple or HTTP::Daemon from CPAN.