Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Using map to create a hash/bag from an array

by GrandFather (Cardinal)
on Dec 17, 2005 at 10:41 UTC ( #517462=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    ...
    my %hash;
    @hash{qw(a b c)} = (1) x 3;
    print Dumper (\%hash);
    
  2. or download this
    $VAR1 = {
              'c' => 1,
              'a' => 1,
              'b' => 1
            };
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2015-01-26 14:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (192 votes), past polls