Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Recursing through hash of arrays

by LanceDeeply (Chaplain)
on Jun 24, 2003 at 18:14 UTC ( [id://268627]=note: print w/replies, xml ) Need Help??


in reply to Recursing through hash of arrays

since references aren't your strongest point, try explicitly assigning variables to them. it really helps to get a feel of what's going on...
sub print_tree { my $key = shift; my $tab = shift; print "$tab$key\n"; my $array_ref = $found{$key}; if ($array_ref) { $tab .= "\t"; foreach my $element (@{$array_ref}) { print_tree($element,$tab); } } } __DATA__ output: start a c f e b d e g

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-20 05:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found