Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

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"; }

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (11)
As of 2016-10-27 15:36 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (365 votes). Check out past polls.