D.2. Perl Symbolic Debugger Commands
Start the debugger with the Perl -d command line argument. Specifying a script on the command line will start the debugger with that script. The debugger supports the commands in the following table.
Command | Use |
---|---|
h | Prints out a help message. |
T | Prints a stack trace. |
s | Single-steps forward. |
n | Single-steps forward around a subroutine call. |
RETURN (key) | Repeats the last s or n debugger command. |
r | Returns from the current subroutine. |
c [ line ] | Continues until line, breakpoint, or exit. |
p expr | Prints expr. |
l [ range ] | Lists a range of lines. range may be a number, a subroutine name, or one of the following formats: start-end, start+amount. (Omitting range lists the next window.) |
w | Lists window around current line. |
- | Lists previous window. |
f file | Switches to file. |
l sub | Lists the subroutine sub. |
S | List the names of all subroutines. |
/pattern/ | Searches forward for pattern. |
?pattern? | Searches backward for pattern. |
b [ line [ condition ]] | Sets breakpoint at line for the specified condition. If line is omitted, the current line is used. |
b sub [ condition ] | Sets breakpoint at the subroutine sub for the specified condition. |
d [ line ] | Deletes breakpoint at line. |
D | Deletes all breakpoints. |
L | Lists lines that currently have breakpoints or actions. |
a line command | Sets an action for line. |
A | Deletes all line actions. |
< command | Sets command to be executed before every debugger prompt. |
> command | Sets command to be executed before every s, c, or n command. |
V [ package [ vars ]] | Lists all variables or specified vars ... |
Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.