local $SIG{ALRM} = sub { die 'what happened?' }; eval { alarm 2; # about two seconds 1 while 1; }; if( $@ ){ print "Whew! Glad that timed out!\n"; }
In reply to Re: Re: Catching Infinite Loops
by Rhandom
in thread catching infinite loops
by cLive ;-)
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |