What's the debugger for Perl?
I came from PHP, and I used zenddebugger to debug PHP.
How can I d开发者_运维技巧ebug Perl?
Using the built-in Perl debugger:
perldoc perldebug
While Jonathan's answer is optimal, using the strict and warning pragmas:
use strict;
use warnings;
Will help you catch the majority of your errors if you aren't already using them.
Here is my debugging tip recycled from perlmonks.
Let the debugger automatically stop program execution whenever a warning is issued from the Perl runtime system. So you can look at the context of the problem and investigate.
This node is giving the motivation and here it is in its final form.
In any way you choose, don't forget to add Data::Dumper
to your debugging routines.
Devel::Peek is a good data debugging tool.
精彩评论