#!/usr/bin/perl use warnings; use strict; use IO::Socket::INET; my $target=; chomp $alvo; my $socket = IO::Socket::INET ->new( PeerAddr =>"$alvo", PeerPort =>"80", Timeout =>"10", Proto =>"tcp ); if ($socket){ print "Works!"; } else { print "fail!"; }