in reply to Finding the exact line in eval'ed code when alarm timed out

Check out caller:

local $SIG{ALRM} = sub { my @context = caller 0; die "timeout: in $context[1] at line $context[2]\n" };

Perl reduces RSI - it saves typing

Replies are listed 'Best First'.
Re^2: Finding the exact line in eval'ed code when alarm timed out
by kurtis (Novice) on Oct 13, 2008 at 20:56 UTC
    That worked perfectly, thanks!