|
|
| "be consistent" | |
| PerlMonks |
Re^2: Getting file and line number where a subroutine is declaredby Ovid (Cardinal) |
| on Feb 02, 2009 at 17:31 UTC ( #740753=note: print w/ replies, xml ) | Need Help?? |
|
The problem with those, I think, is the problem I had above. They won't work if the code is declared after I try to inspect it because GV->LINE apparently reports the first glob entry ... and that's created when I take the reference. On P5P, Rafael suggested I use START->line instead. It returns the line number of the first expression encountered in the sub. Not perfect, but close enough to what I want (I also encountered GV->LINE returning the line number of the closing curly brace in the sub. Much worse than START. Cheers,
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||