Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
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 meditating upon the Monastery: (4)
As of 2014-09-20 04:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (152 votes), past polls