in reply to Checking Port Open or Close

I don't know what you're after, but I just wanted to point out that
$socket = IO::Socket::INET->new(Proto=>"udp", PeerPort=>"162", PeerAdd +r=>"192.168.1.1") || 1000; if($socket==1000)
is a weird and bad way of writing
$socket = IO::Socket::INET->new(Proto=>"udp", PeerPort=>"162", PeerAdd +r=>"192.168.1.1"); if($socket)