There's more than one way to do things | |
PerlMonks |
Re: How to make this substitutions without splitting the strings? (compute not reckon)by Anonymous Monk |
on Jul 28, 2014 at 09:37 UTC ( [id://1095316]=note: print w/replies, xml ) | Need Help?? |
The problem is that I have a very large file of such cases and split would be rather slow I reckon. Any faster way maybe? Don't reckon, compute :) What size is "very large file"? Split is bound to faster , matching (or substituting) on large strings is slow in perl, for example, matching against a 30mb string might take 10 minute, while splitting the string and then matching (30mb array) takes 3 seconds Test it out :) Re^3: Increasing the efficiency of a viral clonal expansion model , Re: Print in loop or store and print once done (bench)
In Section
Seekers of Perl Wisdom
|
|