in reply to Re^2: How Do I Get the Line Number In My Error Message?
in thread How Do I Get the Line Number In My Error Message?

If you want information about your caller, maybe ask Perl about it. The caller function gives you the name of your caller and the line number and file it came from, where applicable.

sub DebugPrint { my $msg = shift; my ($package,$filename,$line,$subroutine) = caller(1); print "Called from $subroutine(): $msg"; }