in reply to Update on script

If you're not using anything else from LWP::UserAgent, you can save a few lines by using LWP::Simple instead:
use LWP::Simple; sub check_httpd { if( get 'http://www.example.com' ){ ... return 1; } ... return 0;