in reply to Out of memory

I suspect that the code is reading the entire file
Your suspicion is correct. The following line reads the whole file into an array of lines:
my @file = <dlthis>;

Remove the line and change the following for-loop into a while-loop:

while ($line = <dlthis>) {

It will process the file line by line (untested).

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Out of memory
by wrkrbeee (Scribe) on Jan 15, 2015 at 15:13 UTC
    Great! This will require a curly bracket to close the WHILE loop, correct? If so, I am placing the closing bracket after the last curly bracket in the code, correct? Thank you so much!!
      No, just reuse the right curly bracket that originally closed the for-loop.
      لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
        My apologies, I misunderstood your suggestion, got it now. I am very grateful for tolerance concerning my knowledge of PERL.
        Hi choroba, I replaced the "for each" loop with the "while" loop, but continue to receive the out of memory error. FYI, the crash occurs when downloading a 450MB text file, if that helps. Machine has 6gb of memory installed. I apologize for my ignorance, what I know about PERL fits easily in a doll house thimble.
      No like already said you have to replace the for-loop

      Look this is no " copy and pasted code fixing service" , you need to to try to understand what your code does.

      Cheers Rolf

      PS: Je suis Charlie!