in reply to Re: 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

I am not very familiar with threads. Can you may be show me how to do that ? I would really appreciate that. :)
  • Comment on Re^2: Fastest way to determine whether a specific port is open via a Socket

Replies are listed 'Best First'.
Re^3: Fastest way to determine whether a specific port is open via a Socket
by Nemurenai (Acolyte) on Oct 30, 2006 at 21:49 UTC
    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";