Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

find substring faster

by Diane4Luo
on May 29, 2011 at 14:53 UTC ( #907213=perlquestion: print w/ replies, xml ) Need Help??
Diane4Luo has asked for the wisdom of the Perl Monks concerning the following question:

In a set of unique sequences, I need to find substring sequences and get rid of them. Do you know how to do it faster? My input file is 52 MB. Thanks,

Comment on find substring faster
Re: find substring faster
by thezip (Vicar) on May 29, 2011 at 15:01 UTC

    Volo a infantia equus.

    What can be asserted without proof can be dismissed without proof. - Christopher Hitchens
Re: find substring faster
by SimonClinch (Chaplain) on May 29, 2011 at 15:25 UTC
    See perlre and perlretut. Hint - its exactly the same syntax as with sed in this case. But first disable carriage control for the filehandle using local $/ = undef(); It's more efficient than using multiline substitution.

    One world, one people

Re: find substring faster
by salva (Monsignor) on May 29, 2011 at 15:43 UTC
Re: find substring faster
by roboticus (Canon) on May 29, 2011 at 16:07 UTC


    Ermmm.... faster than what?


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

Re: find substring faster
by planetscape (Canon) on May 29, 2011 at 17:40 UTC
      yes. We are working together on this project. Thanks!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://907213]
Approved by salva
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-08-30 21:57 GMT
Find Nodes?
    Voting Booth?

    The best computer themed movie is:

    Results (294 votes), past polls