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"; }
In reply to Re: line number
by Molt
in thread line number
by Jaap
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |