Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl Idioms Explained - keys %{{map{$_=>1}@list}}

by dragonchild (Archbishop)
on Aug 04, 2003 at 14:06 UTC ( #280681=note: print w/replies, xml ) Need Help??


in reply to Perl Idioms Explained - keys %{{map{$_=>1}@list}}

Along similar lines, I will often create a hash of keys which are needed for lookup. For example, I will do:
my %acceptable_server = map { $_ => 1 } qw( DEV QA PROD );
It's a nice way of working with a changing list of static acceptable things.

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://280681]
help
Chatterbox?
[choroba]: Can you steal the code from pm-cb-g?
[Tanktalus]: maybe next week at the earliest. :P
[Tux]: Don't you ♥ Unicode :)
[Tanktalus]: Tux: usually, yes. :P

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2017-09-25 21:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (291 votes). Check out past polls.

    Notices?