in reply to How to remove a whole line if matches a keyword in a file.

You might want to try this one-liner:
$ echo 'foo > bar > foobar > baz > foobar' | perl -ne 'print unless /^bar/;' foo foobar baz foobar
The output might be redirected to a file if needed.