|
|
| The stupid question is the question not asked | |
| PerlMonks |
Re: Request to detect the mistake in a perl script for finding inter-substring distance from a large text fileby rovf (Priest) |
| on Jan 24, 2012 at 10:02 UTC ( #949632=note: print w/ replies, xml ) | Need Help?? |
|
This piece of code doesn't make sense. First, you read the *whole* file into memory (storing it at @lines), and then you try to read another line (your while loop), which is, of course, not possible. Your loop won't be executed; you can remove it without harm.
But the main problem is that you read the whole file into memory and process it from there. No wonder that your memory gets exhausted sooner or later (try to pour a whole bottle of beer into a coffee cup; unless the cup is really huge, you will spill some beer).
-- Ronald Fischer <ynnor@mm.st>
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||