I would like to trace my Perl script, but only code in the main
package, and redirect output to a file.
When starting the script with perl -d script.pl
it goes into interactive mode.
I have tried
perl -d:Trace perl_05.pl 2&> output.log
But this also traces all subroutines and modules which I do not want.
I am looking for something like the bash set -o xtrace
or sh -x
.