For providing the error location, Carp::croak is very good. For getting the location in some filehandle, the documentation of $. says that it's the line number of the last file accessed, so you might have to (re)read a line from that file to make $. work the way you intend.
Update: s/Croak/Carp/, as spotted by toolic
In reply to Re: How do I replicate die's magic with $. ?
by Corion
in thread How do I replicate die's magic with $. ?
by tlhackque
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |