use IO::Socket::INET; $sock = IO::Socket::INET->new( PeerAddr => 'www.mysite.com', PeerPort => 80, Proto => 'tcp'); if ($sock) { print "yep"; } else { print "nope"; }