in reply to use constant for strings
Nope, that's not how constants work.
Actually, a constant is really a Perl sub that
returns the 'constant' value. Try using another hash:
Alternatively ... i have a strong suspicion that a CPAN module might exist that contains states and their capitols.use constant WISCONSIN => "WI"; use constant ILLINOIS => "IL"; my %abbrev_map = ( WI => 'WISCONSIN', IL => 'ILLINOIS', ); my %capitol_map = ( WISCONSIN => "Madison", ILLINOIS => "Springfield", ); my $abbrev = "WI"; if ( exists $abbrev_map{$abbrev} ) { print "capitol = $capitol_map{$abbrev_map{$abbrev}}\n"; }
UPDATE 2:
Well, can't seem to find one. The closest matches are:
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|