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

Re: looping in a hashtable

by NetWallah (Abbot)
on Sep 09, 2012 at 20:01 UTC ( #992620=note: print w/ replies, xml ) Need Help??


in reply to looping in a hashtable

Your problem statements in recent submissions are rather confusing.

I think the structure you are seeking is a HASH-OF-ARRAYS. Something like this:

my %Accountinfo; $Accountinfo{E200} = [200, 300, 400]; $Accountinfo{E400} = ["EFG"]; #Now , you can iterate through all stores for all accounts: for my $acct (sort keys %Accountinfo){ for my $store (@{ $Accountinfo{$acct} } ){ print "Account $acct has store $store\n"; } }
If this is confusing, please study REFERENCES in perl. (perldoc perlref from a command line).

             I hope life isn't a big joke, because I don't get it.
                   -SNL


Comment on Re: looping in a hashtable
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2015-07-04 02:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls