Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: examining HASH(0x1234567) in Debugger

by LanX (Saint)
on Jan 01, 2020 at 15:50 UTC ( [id://11110836]=note: print w/replies, xml ) Need Help??


in reply to examining HASH(0x1234567) in Debugger

>   DB<63>  x 1 grep { ...

Couldn't find it documented with h x , but the 1 limits the output to the first level.

Good to know! :)

Update

Demo

DB<17> !1 @a = map +{$_=>[1..3]}, a ..d DB<18> x 1 @a 0 HASH(0xa7041080) 1 HASH(0xa70411c0) 2 HASH(0xa70413e0) 3 HASH(0xa6f048c0) DB<19> x 2 @a 0 HASH(0xa7041080) 'a' => ARRAY(0xa70098d0) 1 HASH(0xa70411c0) 'b' => ARRAY(0xa7027540) 2 HASH(0xa70413e0) 'c' => ARRAY(0xa7027860) 3 HASH(0xa6f048c0) 'd' => ARRAY(0xa7041b70) DB<20>

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^2: examining HASH(0x1234567) in Debugger
by LanX (Saint) on Jan 01, 2020 at 16:06 UTC
    I may have misunderstood your question.

    If you want to dive selectively into a particular sub-hash, why don't you just select that hash by name or index?

    DB<27> x 1 @a 0 HASH(0xa7041080) 1 HASH(0xa70411c0) 2 HASH(0xa70413e0) 3 HASH(0xa6f048c0) DB<28> x grep /080\)/,@a 0 HASH(0xa7041080) 'a' => ARRAY(0xa70098d0) 0 1 1 2 2 3 DB<29> x @a[1] 0 HASH(0xa70411c0) 'b' => ARRAY(0xa7027540) 0 1 1 2 2 3 DB<30>

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2024-04-24 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found