in reply to Re: performing operation on elements not in list?
in thread performing operation on elements not in list?
If the list of keys to keep is static, you want
my $inv = qr/two|three/;
If the list of keys to keep is dynamic, you want
my $inv = do{ local $" = q{|}; qr{@{[ map quotemeta, @keep ]}} };
or the much simpler
my ($inv) = map qr/$_/, join '|', map quotemeta, @keep;
In all cases, use /^$inv\z/ in the grep.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: performing operation on elements not in list?
by johngg (Canon) on Jan 09, 2009 at 22:03 UTC | |
by ikegami (Patriarch) on Jan 09, 2009 at 22:13 UTC | |
by ikegami (Patriarch) on Jan 09, 2009 at 22:15 UTC |