That's a peculiar sounding behavior. Is there any way you can reproduce the problem in a suitably short and nonproprietary snippet?
Returning a one should mean it wasn't the problem I suspected, BTW. Leaving that in place instead of using a bare return should be fine. The usual reason for such a memory jump is copying some sort of large data structure, so you might want to look for other reasons that might happen.
Another possible scenario just popped into my head, but it's pure speculation. Are you perchance calling the subroutine inside a while ( <filehandle> ) { .. } loop? If you are and it's a large binary file, it might be hundreds of megabytes before a newline appears. Again, a reproduction of the problem in a short snippet that doesn't give up any private data would be nice.
|