Debugger Commands

When you type commands into the debugger, you don't need to terminate them with a semicolon. Use a backslash to continue lines (but only in the debugger).

Since the debugger uses eval to execute commands, my, our, and local settings will disappear once the command returns. If a debugger command coincides with some function in your own program, simply precede the function call with anything that doesn't look like a debugger command, such as a leading ; or a +.

If the output of a debugger built-in command scrolls past your screen, just precede the command with a leading pipe symbol so it's run through your pager:

DB<1> |h 

The debugger has plenty of commands, and we divide them (somewhat arbitrarily) into stepping and running, breakpoints, tracing, display, locating code, automatic command execution, and, of course, miscellaneous.

Perhaps the most important command is h, which provides help. If you type h h at the debugger prompt, you'll get a compact help listing designed to fit on one screen. If you type hCOMMAND, you'll get help on that debugger command.

Stepping and Running

The debugger operates by stepping through your program line by line. The following commands let you control what you skip over and where you stop.

Breakpoints

Tracing

Display

Perl's debugger has several commands for examining data structures while your program is stopped at a breakpoint.

Locating Code

Inside the debugger, you can extract and display parts of your program with these commands.

Actions and Command Execution

From inside the debugger, you can specify actions to be taken at particular times. You can also launch external programs.

Miscellaneous Commands