Subject: | Infinite while loop in _read_data |
I was getting a problem where analysing certain files would cause an
'Out of memory' issue on the server. Traced it down to the while loop in
_read_data. The while loop is using the scalar as a boolean, and
although the scalar ($to_read) is decreasing on each loop, it sometimes
becomes a negative number without reaching zero beforehand, and of
course the negative number is being treated as 'true' and the loop
continues.
Using Perl 5.8.8 on CentOS.