See 'perldoc -f exists'. That will tell you if a given scalar is a key in an array.
What do you mean by "extract", though? Do you mean that you want the array to be altered?
@array = grep { ! exists $hash{$_} } @array;Update: That first sentence should end with "in a hash". Thanks to VSarkiss for the typo catch :)
Cheers,
Ovid
New address of my CGI Course.
Silence is Evil (feel free to copy and distribute widely - note copyright text)
In reply to Re: hashes: testing for the presence of a key
by Ovid
in thread hashes: testing for the presence of a key
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |