LanX has asked for the wisdom of the Perl Monks concerning the following question:
whats the simplest way to find source file and line number of a function (start and end)?
the only way I can think of is parsing the output of
B::Deparse->new("-l")->coderef2text( \&func );
that is something like
{ #line 1852 "/usr/share/perl/5.10/perl5db.pl" ... #line 3541 "/usr/share/perl/5.10/perl5db.pl" (); }
Any easier way?
Cheers Rolf
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: finding source position of function
by chromatic (Archbishop) on Aug 13, 2012 at 22:43 UTC | |
by LanX (Saint) on Aug 14, 2012 at 14:08 UTC |