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

Re: Arbitrarily Nested HoH

by bduggan (Pilgrim)
on Oct 15, 2010 at 03:40 UTC ( [id://865393]=note: print w/replies, xml ) Need Help??


in reply to Arbitrarily Nested HoH

I think I'd do it like this :
sub traverse { my ($b, $h) = @_; return ref $h ? map traverse([ @$b, $_ ], $h->{$_}), keys %$h : ( join ',', (@$b, $h) ) . "\n"; } print traverse([], \%hash);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-19 10:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found