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

Re: "Dynamically" Accessing a HoH

by duelafn (Vicar)
on Jun 02, 2005 at 15:45 UTC ( #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
Node Status?
node history
Node Type: note [id://462955]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2021-06-20 21:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (95 votes). Check out past polls.

    Notices?