8

Is there a webserver or HTTP server module in the Perl standard library or in CPAN or elsewhere? I guess I'm looking for the equivalent of Python 3's http.server module. Thanks!

zaphod
  • 4,561
  • 3
  • 25
  • 26
  • 3
    :) I posted the answer 10 minutes before you asked: http://stackoverflow.com/revisions/1899431/list – ysth Dec 15 '09 at 00:32
  • 4
    What for? Is this an http server just to be an http server, or is this an http server in order to do `X`? Knowing either or what X is might lead to more relevant answers. – jsoverson Dec 15 '09 at 00:54
  • 1
    Usually this comes up because I want to slap some kind of crappy UI or API on some prototype or throwaway thing, and wrapping an HTTP server around it seems like it might be an expedient option, depending. I certainly got the answers I was hoping for! – zaphod Dec 15 '09 at 02:07
  • 2
    Curiously, the answers so far point you to the same moudles you would have found by searching "http server" at http://search.cpan.org . At least make it look like you're trying to do your own work. :) – brian d foy Dec 15 '09 at 06:49
  • @zaphod => if your goal is to mock up quick gui's via http, take a look at XUL::Gui which does just that – Eric Strom Dec 15 '09 at 15:19
  • I swear I looked at CPAN first. I made the mistake of clicking on the "Networking Devices IPC" category and carefully reading the resulting list, which turned up nothing remotely useful. Then I tried "man perlmodlib". Then I gave up and asked. – zaphod Jan 06 '10 at 06:10

3 Answers3

15

In addition to HTTP::Daemon, I would recommend taking a look at HTTP::Server::Simple which indeed is very easy to use.

Sinan Ünür
  • 116,958
  • 15
  • 196
  • 339
  • 2
    I've stability issues with HTTP::Server::Simple when running for a long time (several days), but I've had better success with HTTP::Server::Simple w/ Net::Server::PreFork – mpeters Dec 15 '09 at 02:52
  • @mpeters: I use HTTP::Server::Simple for applications that run for a few hours at a time so did not notice such problems but thank you for the heads up. – Sinan Ünür Dec 15 '09 at 03:48
5

See HTTP::Daemon

PP.
  • 10,764
  • 7
  • 45
  • 59
3

Here are a few more:

szabgab
  • 6,202
  • 11
  • 50
  • 64
Pedro Silva
  • 4,672
  • 1
  • 19
  • 31