Perl debugger is similiar to many other line-oriented debuggers.
Viewing the program code during execution
Executing code in the debugger
Viewing variable values
Breakpoints
Summary
List/search source lines:
l [ln|sub] List source code
- or . List previous/current line
v [line] View around line
f filename View source in file
/pattern/ ?patt? Search forw/backw
M Show module versions
Debugger controls:
o [...] Set debugger options
<[<]|{[{]|>[>] [cmd] Do pre/post-prompt
! [N|pat] Redo a previous command
H [-num] Display last num commands
= [a val] Define/list an alias
h [db_cmd] Get help on command
h h Complete help page
|[|]db_cmd Send output to pager
q or ^D Quit |
Control script execution: T Stack trace s [expr] Single step [in expr] n [expr] Next, steps over subs <CR/Enter> Repeat last n or s r Return from subroutine c [ln|sub] Continue until position L List break/watch/actions t [expr] Toggle trace [trace expr] b [ln|event|sub] [cnd] Set breakpoint B ln|* Delete a/all breakpoints a [ln] cmd Do cmd before line A ln|* Delete a/all actions w expr Add a watch expression W expr|* Delete a/all watch exprs ![!] syscmd Run cmd in a subprocess R Attempt a restart |
Data Examination: expr Execute perl code, also see: s,n,t expr x|m expr Evals expr in list context, dumps the result or lists methods. p expr Print expression (uses script's current package). S [[!]pat] List subroutine names [not] matching pattern V [Pk [Vars]] List Variables in Package. Vars can be ~pattern or !pattern. X [Vars] Same as "V current_package [Vars]". i class inheritance tree. y [n [Vars]] List lexicals in higher scope |
|
Examples
In order to debug Perl program using this method you need to install
Demo
......
Examples in this tutorial is taken from http://www.emunix.emich.edu/%7Eevett/BioinformaticsTools/PerlDebugger.html and http://kobesearch.cpan.org/htdocs/perl/perldebtut.pm.html