Webmaster in a Nutshell

Previous Chapter 15 Next

15.28 The Perl Debugger

The Perl symbolic debugger is invoked with perl -d.


Prints out a help message.


Prints a stack trace.


Single steps.


Single steps around subroutine call.


Repeats last s or n.


Returns from the current subroutine.

c [ line ]

Continues (until line, or another breakpoint, or exit).

p expr

Prints expr.

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 next window.


Lists window around current line.


Lists previous window.

f file

Switches to file and starts listing it.

l sub

Lists the named subroutine.


Lists the names of all subroutines.


Searches forward for pattern.


Searches backward for pattern.

b [ line [ condition ]]

Sets breakpoint at line ; default is the current line.

b sub [ condition ]

Sets breakpoint at the subroutine.

d [ line ]

Deletes breakpoint at the given line.


Deletes all breakpoints.


Lists lines that have breakpoints or actions.

a line command

Sets an action for line.


Deletes all line actions.

< command

Sets an action to be executed before every debugger prompt.

> command

Sets an action to be executed before every s, c, or n command.

V [ package [ vars ] ]

Lists all variables in a package. Default package is main.

X [ vars ]

Like V, but assumes current package.

! [ [-]number ]

Re-executes a command. Default is the previous command.

H [ -number ]

Displays the last -number commands of more than one letter.


Toggles trace mode.

= [ alias value ]

Sets alias, or lists current aliases.


Quits. You may also use your EOF character.


Executes command as a Perl statement.

Previous Home Next
Environment Variables Book Index Other CGI Resources