in reply to Re^3: How Do I Get the Line Number In My Error Message?
in thread How Do I Get the Line Number In My Error Message?
Read the docs for caller.
($package, $filename, $line, $subroutine, $hasargs, $wantarray, $evaltext, $is_require, $hints, $bitmask) = caller($i);
You may also want to read "Plain Old Comments (Not!)" and the end of perlsyn -- you can manipulate the file and line numbers that Perl reports.
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|