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

Re: setting hash keys by array

by Felonious (Chaplain)
on Sep 10, 2002 at 14:46 UTC ( #196693=note: print w/ replies, xml ) Need Help??


in reply to setting hash keys by array

my @arr = qw(red green brown); my $hash; $hash = { $_ => $hash || 1 } for (reverse @arr);
-- O thievish Night, Why should'st thou, but for some felonious end, In thy dark lantern thus close up the stars? --Milton


Comment on Re: setting hash keys by array
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (16)
As of 2014-10-23 12:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls