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

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

by Cody Pendant (Prior)
on Mar 06, 2008 at 02:07 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2020-07-08 11:47 GMT
Find Nodes?
    Voting Booth?

    No recent polls found