in reply to perl one-liner to serve httpd current directory

Your question is almost identical to these two, which include a lot of TIMTOWTDI solutions:

  • Comment on Re: perl one-liner to serve httpd current directory