http://www.perlmonks.org?node_id=994316


in reply to Re: Analyzing Perl Code
in thread Analyzing Perl Code

Thanks toolic! These modules seem to be great and much easier to use, though, they produce really detailed traces (one line for every statement). I would like just one line for each subroutine entered, because the scripts I'm working with are really long. Nevertheless, I will try these modules and see how it works out. :)

Replies are listed 'Best First'.
Re^3: Analyzing Perl Code
by Jenda (Abbot) on Sep 19, 2012 at 00:06 UTC
      Thanks Jan, I noticed that your module uses Hook::LexWrap too. So I was moving in the right direction after all. Today I found this other module Debug::Trace. I have a feeling TraceSubs is probably better with it's indented output representing call depth. Debug::Trace on the other hand doesn't require any changes in the source code. Are there any other differences?

        I've never used Debug::Trace and it's ages since I used Debug::TraceSubs for the last time so I can't comment.

        To minimize the changes to the code you can put all the Devel::TraceSubs related code into a separate file and add just require 'that_file.pl'; into the source, under the use statements. It's not perfect, but the $devel_tracesubs->trace() needs to run after all the subroutines you want to track were loaded and defined.

        Jenda
        Enoch was right!
        Enjoy the last years of Rome.

Re^3: Analyzing Perl Code
by davido (Cardinal) on Sep 18, 2012 at 17:43 UTC