Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

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

by Juerd (Abbot)
on Aug 04, 2003 at 13:02 UTC ( #280660=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my %foo = map { $_ => 1 } @foo;
    
    if ($foo{$bar}) {
       ...
    }
    
  2. or download this
    my %foo;
    undef @foo{@foo};
    ...
    if (exists $foo{$bar}) {
       ...
    }
    
  3. or download this
    if (grep $_ eq $bar, @foo) {
       ...
    }
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2014-11-28 18:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (199 votes), past polls