use Net::Ping; $url = <>; $p = Net::Ping->new(); if ($p->ping($url)) { print "working"; } else {print "not working"; }