in reply to determining the line# of code when an alarm() trips?
Is something like:
use strict; use warnings; my $pos; $SIG{ALRM} = 'doReport'; alarm (2); eval {doFail ()}; sub doFail { while (1) { $pos = 1; $pos = 2; $pos = 3; $pos = 4; } } sub doReport { my ($package, $filename, $line, $subroutine) = caller 0; print "$line, $subroutine (pos = $pos)\n"; exit; }
Prints:
15, main::doReport (pos = 2)
what you are looking for?
|
|---|