in reply to line number
It's all done by the caller function, do a perldoc -f caller to see how. The following is a quick demo..
#!/usr/bin/perl use strict; use warnings; test(); sub test { # Get info from the caller my ($package, $file, $line) = caller; print "Called from $line of $file in $package\n"; }
|
|---|