Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^6: [perldebugger] calling perldoc from within the debugger (REPL) (THX!)

by LanX (Saint)
on Sep 02, 2009 at 23:02 UTC ( [id://793043]=note: print w/replies, xml ) Need Help??


in reply to Re^5: [perldebugger] calling perldoc from within the debugger (inifile)
in thread [perldebugger] calling perldoc from within the debugger

Thanx, look really easy ... nice work pemungkah! 8)

I have to figure out a good automated context strategy...

... hmm ...I think it's appropriate to default to list evaluation like with the x-cmd since I can always use scalar to do otherwise.

But it's somehow useless to get just one line with index 0 for dumping a scalar

DB<4> print "my father plays dominos\n" my father plays dominos 0 1

Do you know a way to change this behavior automatically for a one element list like with p-cmd?

DB<4> print "my father plays dominos\n" 1my father plays dominos

as far as I can understand from the docs of DB it's neccessary to manipulate dumpvar.pl to achieve this... right?

Cheers Rolf

Replies are listed 'Best First'.
Re^7: [perldebugger] calling perldoc from within the debugger (REPL) (THX!)
by pemungkah (Priest) on Sep 03, 2009 at 17:22 UTC
    What you're seeing here is an 'x' of the print's return value, which is of course 1 since the print succeeded. We can expand the replacement eval with a crude check for the function being a print, in which case we leave $onetimeDump off.
    sub smarter_eval { local $onetimeDump = 'dump' if $_[0] =~ /\Aprint\s*\(?/; old_eval(@_); }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2025-07-10 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.