Don't use __LINE__.
Instead use [caller(0)]->[2].
See the documentation for the caller function in perlfunc.
Full example:
sub fatal_error { print STDERR "ERROR: ", @_," ",[caller(0)]->[2]; usage(); exit 1; }
In reply to Re: Line numbers
by tobyink
in thread Line numbers
by gg48gg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |