Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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 lurking in the Monastery: (12)
As of 2015-01-27 17:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (201 votes), past polls