in reply to Any call graph tools for perl scripts?
This is a byproduct of an intentional feature: Perl is dynamic. You can define new subs even after the script has begun executing. The already-compiled code may have bytecode which calls a sub which has not yet been compiled. You can eval $script or do $script any time you like, and that new script can override or fulfill the previously mentioned set of subs. The AUTOLOAD mechanism exploits this.
Sometimes I'd like to see a call-tree too. I'd feed trees to GraphViz to illuminate unfamiliar code.
I think you'll have to accept one of two possible approaches: (1) generate a call-tree of only the subs defined in static script code, with some hacks to allow for AUTOLOAD examples or other detectable situations, or (2) generate the call tree from repeated investigation of the bytecode over the course of executing the script.
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Any call graph tools for perl scripts?
by simonm (Vicar) on Jul 17, 2003 at 16:51 UTC | |
by RockyMtn (Novice) on Sep 02, 2015 at 20:38 UTC |