Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^5: Hash assignments using map

by shmem (Chancellor)
on Feb 24, 2007 at 20:32 UTC ( [id://601914]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @keys = qw{ a b c d };
    my %hash = map { $_,1 } @keys;
    
  2. or download this
    my %hash;
    foreach ( @keys ) {
        $hash{$_}++;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2024-04-23 07:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found