And of course, this approach allows a number to represent more than one color, if this is necessary:
c:\@Work\Perl\monks>perl -wMstrict -le "my $color = 7; ;; my %colors = qw(blue 1 green 7 red 3 pink 7 purple 6); ;; my @picked = grep { $colors{$_} eq $color } keys %colors; print qq{color(s) picked by $color: @picked}; " color(s) picked by 7: green pink
Give a man a fish: <%-{-{-{-<
In reply to Re^2: How to print specific word from array/hash?
by AnomalousMonk
in thread How to print specific word from array/hash?
by bananabread
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |