kurtis has asked for the wisdom of the Perl Monks concerning the following question:
local $SIG{ALRM} = sub { die "timeout" }; eval { alarm(12); require './main.pl'; &generate_page; alarm(0); }; if ($@) { if ( $@ =~ /timeout/ ) { croak "TIMEOUT: $@"; } else { alarm(0); # clear the still-pending alarm die "$@"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding the exact line in eval'ed code when alarm timed out
by GrandFather (Saint) on Oct 13, 2008 at 20:43 UTC | |
by kurtis (Novice) on Oct 13, 2008 at 20:56 UTC |