Hello,

>From the code below:

  eval {
    local $SIG{ALRM} = sub { die "TIMEOUT\n" };
    alarm($seconds);
    ... code to execute with timeout here ...
    alarm(0);  # cancel alarm (if code ran fast)
  };
  alarm(0);    # cancel alarm (if eval failed)


Is the second alarm(0) needed or not?
In my before experience, I used only one alarm(0) in eval {  }.

Please suggest, thanks.

Jenn.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to