Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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

by dragonchild (Archbishop)
on Aug 04, 2003 at 14:06 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://280681]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2024-04-19 07:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found