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

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