Is there a way to turn on tracing in perl (equivalent to bash -x)?

Viewed 22114

I have a system script in perl. I need some equivalent of bash -x to determine what is going wrong with the script. Is there something equivalent?

EDIT: What bash -x does is that it prints each line as it is evaluated. This makes debugging code that is just missing some path variable or file very easy.

5 Answers

If you are running a current version of perl you can use Devel::Agent.

perl -d:Agent -MDevel::Agent::EveryThing myscript.pl
Related