in reply to Premature End-of-File - Scope problems?

Hi bratwiz,

It's because this line:

foreach my $line (<FILE_FD>) { # pull records from replay file

is reading every line from the file into memory.

You should read only as far as you need to each time.

For example:

while (my $line = <FILE_FD>) { # just read a line at a time

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/

Replies are listed 'Best First'.
Re^2: Premature End-of-File - Scope problems?
by bratwiz (Sexton) on Feb 15, 2007 at 00:43 UTC
    DUH! (looking sheepish now) You're absolutely right. And the dumbest bit of all is I _do_ use that construct nearly 99.999% of the time and for whatever reason just didn't this time. I love this site. It teaches me humility :) Thanks