Turning on Debugging for a perl script

for security reasons I can not post any part of the script in question in this thread. i hope im not breaking any rules by not doing so.

but i have a perl script that i've been asked to turn on debugging on.

i didn't write this perl script and i have very very little knowledge of perl. so i have no idea what to do.

i know in bash programming, to turn on debugging, you just simply add a "set -x" to the beginning of the script, right after the defining the shell to use.

but in perl, i'm presuming there has to be a similar straight to the point code i can insert into the script to start debugging it?

Put this at top of script:

#!/usr/bin/perl
use warnings;

Then run it with -d, like this:

./test.pl -d
2 Likes

Also, if you want even more debugging information (long winded) add this line:

use diagnostics;
2 Likes

you guys are the best!