[Israel.pm] finding fuul name of a function

Gaal Yahas gaal at forum2.org
Tue Mar 8 01:58:14 PST 2005


Yossi.Itzkovich at ecitele.com wrote:

>I have a perl script that someone else wrote it. It uses few modules.
>
>In the code he calls function foo().  How can I find which function is it ?
>in which module it is defined ?
>  
>
Quick and dirty:

     grep -r '^sub foo' src/


If this is a function call, look at the use lines -- the function has 
probably been
exported from one of modules this code calls import on.

If this is a method call, walk @ISA; the good news is that you can do this
programmatically.

If this is tricky code that uses AUTOLOAD, you're in for some quality
time with yout tracer hat.

-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/




More information about the Perl mailing list