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
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>
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? ( { = auto cmd ; X V y = dump by regex)
by LanX
in thread How can I print variable contents from the debugger non-interactively?
by davehorner
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |