in reply to Re^2: Fastest way to determine whether a specific port is open via a Socket
in thread Fastest way to determine whether a specific port is open via a Socket

It's insanely easy actually...if the function is simple; The following should be self-explanatory...I hope.
use warnings; #mmmm use threads; sub myfunc { print "Checking out port\n"; wait 2; return 42; } print "Starting thread\n"; $thread = threads->new(\&myfunc()); print "doing some stuff\n"; wait 4; $result = $thread->join(); print "The result is $result\n";
  • Comment on Re^3: Fastest way to determine whether a specific port is open via a Socket
  • Download Code