Small Web Server in Perl
Archive - Originally posted on "The Horse's Mouth" - 2009-02-18 13:10:41 - Graham EllisI would not encourage you to write your own web server in Perl, but I might suggest that you used the http protocol as a convenient intersystem communication protocol ... and that might result in you implementing part of http for the purpose ;-)
With that proviso in mind, I have just added source code for a miniature server to our web site ... run it on a system and that system will act as a web server, within limits ... and it will give you a springboard from which you can make use of the http protocol and the data uploaded through it.
Running example (visited from a browser on another system):
earth-wind-and-fire:~/Desktop grahamellis$ ./miniserver.pl 4434
/Users/grahamellis/public_html/tictim.html
_status = 200
jjj = iii jkjhhgj
_method = GET
/Users/grahamellis/public_html/favicon.ico
_status = 404
_method = GET
^C
earth-wind-and-fire:~/Desktop grahamellis$
If you're wanting to write code like this, have a look at our Using Perl on The Web course. And if you want to learn how to set up a more regular web server, consider our Apache httpd deployment course instead.