Careful! Without anchors you'll also match on substrings, so better /^$key$/.
Anyway try to avoid regexes when possible and use eq
if ( not grep { $key eq $_ } @keysToKeep) )
Cheers Rolf
( addicted to the Perl Programming Language)
corrected code
In reply to Re^2: Parsing an Array of Hashes, Modifying Key/Value Pairs
by LanX
in thread Parsing an Array of Hashes, Modifying Key/Value Pairs
by librarat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |