Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl verbose output?

Tags:

perl

Is there are a way to get Perl debug output, similar to bash -x but in Perl?

I do not need strikt or diagnose messages (they compile the code but do not print the line that the Perl interpreter executes).

like image 802
Iana Avatar asked May 14 '14 07:05

Iana


1 Answers

Assuming you are using some kind of unix you can use the Devel::Trace perl module. If it is not installed you can install it from CPAN like this:

sudo perl -MCPAN -e 'install Devel::Trace'

Once you have it you can run your script like this:

perl -d:Trace myscript.pl

And it will do exactly what bash -x does (note that the name of the Trace package is case sensitive).

like image 89
John C Avatar answered Nov 02 '22 15:11

John C