Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: How to print specific word from array/hash?

by AnomalousMonk (Archbishop)
on Oct 05, 2016 at 12:22 UTC ( [id://1173333]=note: print w/replies, xml ) Need Help??


in reply to Re: How to print specific word from array/hash?
in thread How to print specific word from array/hash?

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:  <%-{-{-{-<

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (3)
As of 2024-04-18 00:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found