in reply to Out of memory error while Reading 5GB text file
e.g. I would have expected a chomp $lines within the loop. Maybe show us some more code details?while (my $lines = <FIN>) { chomp $sword;
Now if you accidently would parse a file that is not a textfile the inputline may end up being too long and on some systems you could run out of memory.
One cause for the above could be platform differences i.e. if you read on an Windows platform a file originally created on a Unix platform the textline separator might be different and your program may fail to recognise end-of-line.
Note that this problem would not be as bad if the source is Windows and the destination is Unix. In that case you just find an extra "\r" as the last character on the line after you have chomped the input.
|
|---|