http://www.perlmonks.org?node_id=1002993


in reply to remove lines matching list of strings

rootcho:

The fastest way? If you're on a unix box, I'd try using grep. It's specialized for that sort of task.

If you just want to do it with perl, I think reading the entire file into a scalar and then building the giant regex may be the fastest. But you may want to use Benchmark and test to find out what's fast or not.

...roboticus

When your only tool is a hammer, all problems look like your thumb.

  • Comment on Re: remove lines matching list of strings