Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^2: Compare all array values without a loop

by Crian (Curate)
on Oct 19, 2004 at 15:21 UTC ( [id://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} = ();

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (4)
As of 2024-03-19 02:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found