Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: remove lines matching list of strings

by roboticus (Chancellor)
on Nov 08, 2012 at 21:37 UTC ( #1002993=note: print w/replies, xml ) Need Help??

in reply to remove lines matching list of strings


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.


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

  • Comment on Re: remove lines matching list of strings

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1002993]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (4)
As of 2017-08-18 04:21 GMT
Find Nodes?
    Voting Booth?
    Who is your favorite scientist and why?

    Results (294 votes). Check out past polls.