go ahead... be a heretic | |
PerlMonks |
Re^2: Byte repetition checkby FloydATC (Deacon) |
on Dec 11, 2014 at 11:29 UTC ( [id://1110036]=note: print w/replies, xml ) | Need Help?? |
Why not read the file (or blocks of it, if it's too large to conveniently fit into memory) into a buffer and then process that buffer?
This would add a couple of lines of code, but it would save you thousands of system calls and improve performance immensely. Looping through a buffer could then be done using substr() or by split()ting the buffer into an @array which you can then foreach() through.
-- FloydATC
Time flies when you don't know what you're doing
In Section
Seekers of Perl Wisdom
|
|