Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^4: How can I print variable contents from the debugger non-interactively? (@DB::typeahead)

by LanX (Saint)
on Jul 17, 2017 at 16:59 UTC ( [id://1195269]=note: print w/replies, xml ) Need Help??


in reply to Re^3: How can I print variable contents from the debugger non-interactively? (@DB::typeahead)
in thread How can I print variable contents from the debugger non-interactively?

you can also send debugger commands from inside the debugged Perl program ...

(though I don't recommend hard-coding linenumbers there, use $DB::single=1 to set a breakpoint in place)

use strict; use warnings; push @DB::typeahead, 'b 19 $y==3', '{ X y' if exists &DB::DB; $|=1; my $a; our $y; for (0..10) { print; $a++; $y++; }
runs as
DB<22> c 0123auto(-3) DB<22> X y $y = 3 auto(-2) DB<23> b 19 $y==3 auto(-1) DB<24> { X y DB<25> c 45678910auto(-1) DB<25> X y DB<26>

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

  • Comment on Re^4: How can I print variable contents from the debugger non-interactively? (@DB::typeahead)
  • Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1195269]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-23 11:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found