Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: "Dynamically" Accessing a HoH

by duelafn (Parson)
on Jun 02, 2005 at 15:45 UTC ( [id://462955]=note: print w/replies, xml ) Need Help??


in reply to "Dynamically" Accessing a HoH

I'd say, just suck it up and recurse,

sub deep_hash { my $h = shift; return $h unless @_; deep_hash($h->{shift()}, @_); } $xml = { 'depTar' => { 'name' => 'c_p20', 'loc' => 'srvr1' }}; print deep_hash($xml, qw/depTar name/);

Good Day,
    Dean

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-03-28 22:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found