Using perl with Devel::DumpTrace very similar to using bash -x . Like bash -x , Devel::DumpTrace expands and displays the values ββof variables to give you an idea of ββwhat your script is doing, and not just where it does it.
It also has the feature you're looking for: to enable and disable tracking on specific packages. For your use case, you will run it as
perl -d:DumpTrace=-.*,+main my_script.pl
or
perl -d:DumpTrace=-.* my_script.pl
-.* means "exclude from the trace all packets that match /^.*$/ " that is, all packets. +main means "include main trace in trace".
The default output can be quite verbose. If you want less output than this, you can specify quiet mode:
perl -d:DumpTrace=quiet,-.*,+main my_script.pl
(I am the author of Devel::DumpTrace )
source share