in reply to Re^6: Error when running on larger files
in thread Error when running on larger files

It seems to be caused by something earlier in the script

Does the earlier code read the same file? Does the earlier code use much memory?

Perhaps you should post the entire script.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
In the absence of evidence, opinion is indistinguishable from prejudice. Not understood.
  • Comment on Re^7: Error when running on larger files

Replies are listed 'Best First'.
Re^8: Error when running on larger files
by K_Edw (Beadle) on Jun 28, 2016 at 10:41 UTC

    I've found the cause. I used incorrect syntax to try and close multiple filehandles

    close ($OUT,$OUT2,$IN)

    But despite using warnings + strict, I never received a message about this until I switched back to the system Perl. As the input file for this chunk of code is created earlier in the script - not having the filehandle closed led to the error.

    I'm still unclear as to how the script was able to run to completion on some, typically smaller input files - but not others given that almost no memory is required until this step.

      Nice one! (As in, nice bug, if bugs are ever nice.)

      I'm still unclear as to how the script was able to run to completion on some, typically smaller input files - but not others given that almost no memory is required until this step.

      It probably depended on buffering. If the file wasn't close properly, some small portion of the file could remain unwritten depending on the number and length of lines.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice. Not understood.
        Makes sense. Thank you for your time and assistance!