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

Re: Help on Hashes

by hdb (Prior)
on May 14, 2014 at 07:35 UTC ( #1085986=note: print w/ replies, xml ) Need Help??


in reply to Help on Hashes

It is better to store your data in a hash of array (references) like this:

use strict; use warnings; my %COL_CHECK = ( A => [ qw( NAME CITY STATE ) ], B => [ qw( NAME CITY STATE COUNTY ) ], C => [ qw( NAME AGE STATE COUNTY ) ], D => [ qw( NAME AGE CITY STATE COUNTY ) ], E => [ qw( NAME AGE DESIGNATION CITY STATE COUNTY ) ] ); for my $key (@{$COL_CHECK{$ARGV[0]}}) { print "$key\n"; }


Comment on Re: Help on Hashes
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (11)
As of 2014-09-16 16:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (35 votes), past polls