in reply to Re: Catching Infinite Loops
in thread catching infinite loops

Ditto but with some code...
local $SIG{ALRM} = sub { die 'what happened?' }; eval { alarm 2; # about two seconds 1 while 1; }; if( $@ ){ print "Whew! Glad that timed out!\n"; }