http://www.perlmonks.org?node_id=1050471


in reply to 500 Can't connect to localhost:80 (Connection Refused) at ./sample.pl line 19

What is your question? Why is connection refused? Thats impossible to know from perl code -- ask the bartender why he won't serve you drinks (ask webserver, firewall... -- check logs).