Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Hash of Arrays (populating and iterating)

by Cody Pendant (Prior)
on Mar 06, 2008 at 02:07 UTC ( [id://672330]=note: print w/replies, xml ) Need Help??


in reply to Re: Hash of Arrays (populating and iterating)
in thread Hash of Arrays (populating and iterating)

Or this way -- why bother with indexes at all?
foreach $animal ( @{ $animals{pets} } ) { push ( @some_animals, $animal ); }


Nobody says perl looks like line-noise any more
kids today don't know what line-noise IS ...

Replies are listed 'Best First'.
Re^3: Hash of Arrays (populating and iterating)
by USP45 (Novice) on Mar 06, 2008 at 14:41 UTC
    That's true. I tried it that way at first and got unexpected results (the array getting treated as 1 item when I tried to sort and make the elements unique) but it's probably because I was using qq incorrectly to populate the hash in the first place. I should have used qw and the elements would have been separate elements.

Log In?
Username:
Password:

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

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

    No recent polls found