in reply to Extract word
The first problem is that you do the same thing regardless of the truth of defined $ignore{$word}.
You could use the following:
Or maybe you want to skip the entire line:perl -pe's/\band\b//g;' in > out
perl -ne'print if !/\band\b/;' in > out
|
|---|