If you invoke
perl
with a
-d
switch, your script will be run under a debugging monitor.
It will halt before the first executable statement and ask you for a
command, such as:
Set a breakpoint.
If line is omitted, sets a breakpoint on the
line that is about to be executed.
If a condition is specified, it is evaluated each time the statement is
reached and a breakpoint is taken only if the condition is true.
Breakpoints may only be set on lines that begin an executable statement.
Set an action to happen after the prompt when you've just given a command
to return to executing the script.
A multi-line command may be entered by backslashing the newlines.
Same as "print DB'OUT expr".
The DB'OUT filehandle is opened to /dev/tty, regardless of where STDOUT
may be redirected to.
If you want to modify the debugger, copy perldb.pl from the perl library
to your current directory and modify it as necessary.
(You'll also have to put -I. on your command line.)
You can do some customization by setting up a .perldb file which contains
initialization code.
For instance, you could make aliases like these: