Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re^2: searching an array

by Articuno (Beadle)
on Jan 03, 2006 at 15:45 UTC ( #520635=note: print w/ replies, xml ) Need Help??

in reply to Re: searching an array
in thread searching an array

I prefer

my @lookup{@array} = undef;
to (*)
my %lookup = map { $_ => undef } @array;

(*) should it be "to" or "instead of" ?

-- 6x9=42

Comment on Re^2: searching an array
Select or Download Code
Replies are listed 'Best First'.
Re^3: searching an array
by Roy Johnson (Monsignor) on Jan 03, 2006 at 15:51 UTC
    Except that's a syntax error. You can't declare a hash slice. You'd have to declare the hash, then do the slice-assignment.

    Caution: Contents may have been coded under pressure.
      Oh, ok... I need more sleep... :-)

      -- 6x9=42

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2016-02-07 14:16 GMT
Find Nodes?
    Voting Booth?

    How many photographs, souvenirs, artworks, trophies or other decorative objects are displayed in your home?

    Results (253 votes), past polls