compile-fan
compile-fan

Reputation: 17615

What's the debugger for Perl?

I came from PHP, and I used zenddebugger to debug PHP.

How can I debug Perl?

Upvotes: 6

Views: 233

Answers (5)

Cooper
Cooper

Reputation: 679

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.

Upvotes: 6

snoofkin
snoofkin

Reputation: 8895

In any way you choose, don't forget to add Data::Dumper to your debugging routines.

Upvotes: 1

Jonathan Leffler
Jonathan Leffler

Reputation: 753625

Using the built-in Perl debugger:

perldoc perldebug

Upvotes: 15

Chankey Pathak
Chankey Pathak

Reputation: 21666

Devel::Peek is a good data debugging tool.

Upvotes: 0

hexcoder
hexcoder

Reputation: 1220

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.

Upvotes: 5

Related Questions