Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Compare all array values without a loop

by Crian (Chaplain)
on Oct 19, 2004 at 15:21 UTC ( #400558=note: print w/ replies, xml ) Need Help??


in reply to Re: Compare all array values without a loop
in thread Compare all array values without a loop

Instead of

@array = ('A','B','C','D'); for (@array) { $hash{$_} = undef; }
you can use
my @array = qw/A B C D/; my %hash; @hash{@array} = ();


Comment on Re^2: Compare all array values without a loop
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2014-08-28 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (253 votes), past polls