perldebguts (1) Linux Manual Page
NAME
perldebguts – Guts of Perl debugging
DESCRIPTION
This is not perldebug, which tells you how to use the debugger. This manpage describes low-level details concerning the debugger’s internals, which range from difficult to impossible to understand for anyone who isn’t incredibly intimate with Perl’s guts. Caveat lector.
Debugger Internals
Perl has special debugging hooks at compile-time and run-time used to create debugging environments. These hooks are not to be confused with the perl -Dxxx command described in perlrun, which is usable only if a special Perl is built per the instructions in the INSTALL podpage in the Perl source tree.
For example, whenever you call Perl’s built-in "caller" function from the package "DB", the arguments that the corresponding stack frame was called with are copied to the @DB::args array. These mechanisms are enabled by calling Perl with the -d switch. Specifically, the following additional features are enabled (cf. “$^P” in perlvar):
- •
- Perl inserts the contents of $ENV{PERL5DB} (or "BEGIN {require 'perl5db.pl'}" if not present) before the first line of your program.
- •
- Each array "@{"_<$filename"}" holds the lines of $filename for a file compiled by Perl. The same is also true for "eval"ed strings that contain subroutines, or which are currently being executed. The $filename for "eval"ed strings looks like "(eval 34)".
Values in this array are magical in numeric context: they compare equal to zero only if the line is not breakable.
- •
- Each hash "%{"_<$filename"}" contains breakpoints and actions keyed by line number. Individual entries (as opposed to the whole hash) are settable. Perl only cares about Boolean true here, although the values used by perl5db.pl have the form "$break_condition
