Perl debugging enhancement

I often have to debug my Perl program, some of them are very large and do not run perl xxx.pl.

I have a Python pdb module that can set a breakpoint in a program using

pdb.set_trace()

When this point is executed, the program will produce an interactive python shell. Then I can debug. I want to know that in Perl there is such a module or debugging method? I also want to know other debugging support in perl and its modules.

+5
source share
3 answers

I found a module: Enbugger - Enables a debugger at runtime.

what i wanted.

CLASS->stop

which can stop the program from starting and issue a debugging shell.

, perl5db. , : Devel::Trepan

+1
+2

Perl script:

http://www.ehow.com/how_2095026_debug-perl-programs.html

perl -d yourscript.pl

Set breakpoints using the "b" command in sections of the code that you think are broken. Breakpoints tell the debugger to stop debugging when it reaches this line or function. They can be installed on line or function and can have conditions. For example, to set breakpoints on line 531 with the condition "$ a> 10", you would use the following command: "b 531 $ a> 10"

Run the program using the "r" command. This will run the program until a breakpoint is reached.

+1
source

All Articles