What's the debugger for 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.

Tags:

Debugging

Perl