Debugging Perl Programs
Introduction
There are several ways to debug Perl programs, to find the cause of bugs, and to find a good solution for them. Many Perl beginners don't make use of the Perl's debuggers, such as the -d
flag or the various Devel:: modules. This is unfortunate because they are very convenient and can save a lot of time.
Debugging Resources
perldebtut - the Perl debugging Tutorial
Covers the default perl -d
debugger.
Perl for Perl Newbies Series
The material of the second presentation contains a brief introduction to using the perl -d Debugger.
Debugging Aids
Devel-Trace
Allows one to print each line before it is executed.
Devel-LineTrace
Allows one to assign code to be executed on individual lines in the program. This allows to use it instead of adding print's to the code, which later need to be removed.
Graphical Debugger Front-ends
While not full-fledged IDEs, these tools are useful as graphical debugger front-ends.
Devel-ptkdb - a Perl/Tk based graphical debugger. Was not maintained since 2004, but may still get the job done.
GNU DDD (The Data Display Debugger) - a Motif-based graphical front-end to several debuggers including the perl debugger.
perldbgui - another Perl/Tk GUI for the Perl debugger. Stuck at DR-1.
Enhanced Debuggers
Devel-Trepan
An enhanced debugger for Perl, which, while originally derived from perl5db.pl
, broke internal and external compatibility with the aim of making Trepan easier to use.