in reply to performing operation on elements not in list?
Like this perhaps
$ perl -le ' > %h = ( one => 1, two => 1, three => 1 ); > $inv = do{ local $" = q{|}; qr{^@{ [ qw{ two three } ] }$} }; > map $h{ $_ } = 0, grep ! /$inv/, keys %h; > print qq{$_ - $h{ $_ }} for keys %h;' three - 1 one - 0 two - 1 $
Cheers,
JohnGG
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: performing operation on elements not in list?
by ikegami (Patriarch) on Jan 09, 2009 at 21:46 UTC | |
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 |