in reply to Re: How do I replicate die's magic with $. ?
in thread How do I replicate die's magic with $. ?
Thanks for the reply, but that doesn't answer my question. As I thought I was careful to explain, I know the error location, but I need to determine the name of the file handle associated with the value in $.. And as a library that doesn't do file IO, I have no clue what the file might be.
There's got to be a better way than:my $msg = " at yourbadscript line your mistake"; if( defined $. ) { local $@ = ''; eval { die; }; if($@ =~ /^Died at .*(, <.*?> line \d+).$/ ) { $msg .= $1; } } $msg .= ".\n"; die $msg;
This communication may not represent my employer's views, if any, on the matters discussed.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How do I replicate die's magic with $. ?
by chromatic (Archbishop) on Aug 06, 2011 at 17:50 UTC | |
by tlhackque (Beadle) on Aug 06, 2011 at 18:21 UTC | |
by Corion (Patriarch) on Aug 06, 2011 at 18:26 UTC | |
by JavaFan (Canon) on Aug 08, 2011 at 09:14 UTC |