The Perl symbolic debugger is invoked with perl -d.
Any input to the debugger that is not one of the commands enumerated below is evaluated as a Perl expression.
a
[ line ] commandSets an action for line.
A
[ line ]Deletes the action at the given line; default is the current line. If line is *
, deletes all line actions.
b
[ line [ condition ] ]Sets a breakpoint at line; default is the current line.
b
subname [ condition ]Sets a breakpoint at the named subroutine.
b compile
subnameStops after the subroutine is compiled.
b load
fileSets a breakpoint at requireing the given file.
b postpone
subname [ condition ]Sets a breakpoint at the first line of the subroutine after it is compiled.
B
[ line ]Deletes the breakpoint at the given line; default is the current line. If line is *
, deletes all breakpoints.
c
[ line ]Continues (until line, or another breakpoint, or exit).
f
fileSwitches to file and starts listing it.
h
Prints out a long help message.
h
cmdPrints out help for debugger command cmd.
h h
Prints out a concise help message.
H
[ -number ]Displays the last -number commands.
l
[ range ]Lists a range of lines. range may be a number, start - end, start + amount, or a subroutine name. If range is omitted, lists the next screenful.
l
subnameLists the named subroutine.
L
[ a
|b
|w ]Lists lines with actions, breakpoints, or watches.
m
classPrints the methods callable via the given class.
m
exprEvaluates the expression in list context, prints the methods callable on the first element of the result.
man
[ topic ]Views system documentation.
Shows versions of loaded modules.
n
[ expr ]Single steps around the subroutine call.
o
[ opt [ =
val ] ]Sets values of debugger options. Default value is true.
o
opt ?
Queries values of debugger options.
p
expr†Evaluates expr in list context and prints the result. See also x
on the next page.
q
Quits the debugger. An end of file condition on the debugger input will also quit.
r
R
Restarts the debugger.
s
[ expr ]Single steps.
source
fileExecutes the debugger commands in the named file.
S
[ !
] patternLists the names of all subroutines [not] matching the pattern.
t
Toggles trace mode.
t
exprTraces through execution of expr.
T
Prints a stack trace.
v
[ line ]Lists a screenful of lines around the specified line.
V
[ package [ pattern ] ]Lists variables matching pattern in a package. Default package is main.
w
exprAdds a global watch-expression.
W
[ expr ]Deletes the global watch-expression. If expr is *
, deletes all watch-expressions.
x
exprEvaluates expr in list context and dumps the result.
X
[ pattern ]Like V
, but assumes the current package.
y
[ n [ pattern ] ]Like V
, but lists lexicals in higher scope n. Requires the optional module PadWalker.
Returns to the executed line.
Lists the previous screenful of lines.
=
[ alias [ value ] ]Sets or queries an alias, or lists the current aliases.
Searches forward for pattern.
?
pattern [ ?
]Searches backward for pattern.
<
commandSets an action to be executed before every debugger prompt. If command is ?
, lists current actions.
<<
commandAdds an action to the list of actions to be executed before every debugger prompt.
>
commandSets an action to be executed after every debugger prompt. If command is ?
, lists current actions.
>>
commandAdds an action to the list of actions to be executed after every debugger prompt.
{
commandDefines a debugger command to run before each prompt. If command is ?
, lists current commands.
{{
commandAdds a debugger command to the list of debugger commands to run before each prompt.
!
[ [ - ] number ]Re-executes a command. Default is the previous command.
!
[ pattern ]Re-executes the last command that started with pattern.
!!
[ command ]Runs command in a sub-process.
|
cmdRuns debugger command cmd through the current pager.
||
cmdSame as |
cmd, but selects DB::OUT
as well.
Pressing the Enter or Return key at the debugger prompt will repeat the last s
or n
command.
The debugger uses environment variables DISPLAY
, EMACS
, LESS
, MANPATH
, PERL5DB
, PAGER
, OS2_SHELL
, SHELL
, TERM
and WINDOWID
, as well as several other variables all starting with PERLDB_.