> to print all the variable contents when executing line XXX

some hands on examples

a action (per line) and w watchpoint (each time) take Perl code to be evaluated.

you can do pretty nifty things with that already

sample code

use strict; use warnings; $|=1; # disable buffering my $a; our $y; for (0..10) { print; $a++; $y++; }

a = action cmd on line
DB<71> h a a [line] command Set an action to be done before the line is executed; line defaults to the current execution line. Sequence is: check for breakpoint/watchpoint, print line if necessary, do action, prompt user if necessary, execute line. a Does nothing

a doesn't break unless you set $DB::single explicitly to 1

w = watch-expression

DB<79> h w w expr Add a global watch-expression. w Does nothing

w stops if the returned value has changed

w $a would stop each time $a is changing

this only stops if $a is inside the intervall

this only stops for the first print and the first non print (print returns 1)

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!


In reply to Re: How can I print variable contents from the debugger non-interactively? ( a = line action ; w = watch changes everywhere) by LanX
in thread How can I print variable contents from the debugger non-interactively? by davehorner

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.