![]() |
|
XP is just a number | |
PerlMonks |
Re: Request to detect the mistake in a perl script for finding inter-substring distance from a large text fileby lune (Pilgrim) |
on Jan 24, 2012 at 12:09 UTC ( #949661=note: print w/replies, xml ) | Need Help?? |
As far as I can see there is no need to
a) read in the whole file at once b) paste the lines together Your count won't change if you do the counting line by line - which would solve your memory problem. So it would be worth looking at the part of your program that needs the whole file as string to see, whether this could be changed too. If not, there is the proposition about using "tie" already. Then, you can search for all valid characters at once and use a hash to collect and count them. This would be a possible solution:
In Section
Seekers of Perl Wisdom
|
|