Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-11-25 23:41 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (693 votes), past polls