Just in case you have an 'XY' problem in your question, here's a common solution for this class of thing:
my %description = ( a => 'a vowel', b => 'a consonant' ); for my $choice (qw/a b c/){ print "$choice is ", $description{$choice} || "not in the alphabet. +", "\n"; }
Output:
a is a vowel b is a consonant c is not in the alphabet.
-- Human history becomes more and more a race between education and catastrophe. -- HG Wells
In reply to Re: Default Hash Key
by oko1
in thread Default Hash Key
by tford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |