in reply to socket problem

  1. use strict;
  2. use warnings;
  3. Change your start port from 0 to 1
  4. Change your end port from 65535 to 65534.
  5. Speak nicely when asking for help in the chatterbox.

Update: As was stated in the chatterbox, your connections will fail on occassion because there will be no server running on most of the ports you try to connect to. Therefore, dieing isn't what you want there. The if ($sock) { ... } that follows is all you want or need.

Normally, socket read timeouts are handled with either select() or alarm(). I don't know if the socket timeout applies to reads from the socket (it doesn't appear to).

--- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';