Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the debugger for Perl?

Tags:

debugging

perl

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

How can I debug Perl?

like image 945
compile-fan Avatar asked May 26 '11 16:05

compile-fan


People also ask

Does Perl have a debugger?

In Perl, the debugger is not a separate program the way it usually is in the typical compiled environment. Instead, the -d flag tells the compiler to insert source information into the parse trees it's about to hand off to the interpreter.

How do I debug a Perl code in Visual Studio?

From the VS Marketplace plugin page download the extension with the "Download Extension" link on the right hand side. Open a Perl source file, click "Run -> Start Debugging" or hit F5 and observe there is no error as before. Now explore all VSCocde IDE functions working nicely with Perl!


2 Answers

Using the built-in Perl debugger:

perldoc perldebug
like image 146
Jonathan Leffler Avatar answered Nov 15 '22 07:11

Jonathan Leffler


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.

like image 22
Cooper Avatar answered Nov 15 '22 06:11

Cooper