> or print variables named via regex.
The following commands dump variables by regex
DB<162> h X
X [vars] Same as "V currentpackage [vars]".
DB<163> h V
V [pkg [vars]] List some (default all) variables in package (defaul
+t current).
Use ~pattern and !pattern for positive and negative regexps.
DB<164> h y
y [n [Vars]] List lexicals in higher scope <n>. Vars same as V.
With "{" you can tell the debugger to automatically execute these (and other debugger) commands with each prompt, like when single stepping or when running into a breakpoint.
DB<1> h {
{ db_command Define debugger command to run before each prompt.
{ ? List debugger commands to run before each prompt.
{{ db_command Add to the list of debugger commands to run before ea
+ch prompt.
{ * Delete the list of debugger commands to run before eac
+h prompt.
The following example
- sets a conditional breakpoint at line 11
- dumps all variables named y before each prompt
c = continue runs into the breakpoint
s = single step shows the dumping
DB<239> b 11 $a==3
DB<240> L
d:/Users/RolfLangsdorf/AppData/Roaming/pm/tst_debuger.pl:
11: $a++;
break if ($a==3)
DB<240> { X y
DB<241> {
pre-debugger commands:
{ -- X y
DB<241> c
0123auto(-1) DB<241> X y
$y = 3
DB<242> s
auto(-1) DB<242> X y
$y = 3
DB<243> s
auto(-1) DB<243> X y
$y = 4
DB<244> c
45678910auto(-1) DB<244> X y
DB<245>
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|