Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by GrandFather (Saint)
on Dec 17, 2005 at 10:41 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://517462]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (3)
As of 2024-04-16 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found