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.

CommandUse
hPrints out a help message.
TPrints a stack trace.
sSingle-steps forward.
nSingle-steps forward around a subroutine call.
RETURN (key)Repeats the last s or n debugger command.
rReturns from the current subroutine.
c [ line ]Continues until line, breakpoint, or exit.
p exprPrints 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.)
wLists window around current line.
-Lists previous window.
f fileSwitches to file.
l subLists the subroutine sub.
SList 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.
DDeletes all breakpoints.
LLists lines that currently have breakpoints or actions.
a line commandSets an action for line.
ADeletes all line actions.
< commandSets command to be executed before every debugger prompt.
> commandSets 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.