in reply to Re^2: check if an element exists in array
in thread check if an element exists in array
Using @names as before...
my %names_h = map { $_->[0] => 1 } @names; # map { @$_ } @names; # similar, but more scary my $name = 'Jim'; print "Jim's in the hash\n" if $names_h{$name};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: check if an element exists in array
by Anonymous Monk on Apr 19, 2008 at 09:47 UTC | |
by FunkyMonk (Bishop) on Apr 19, 2008 at 09:58 UTC | |
by Anonymous Monk on Apr 19, 2008 at 10:11 UTC | |
by FunkyMonk (Bishop) on Apr 19, 2008 at 10:20 UTC |