Change "foreach $line2 ( <INFO> ) {..."
to
"while( my $line2 = <INFO> ) {..."
Your current implementation slurps the flat file into memory because foreach is a ranged-based loop that evaluates <INFO> in list context, which gives you slurp behavior. while() is a conditional based loop, and thus evaluates <INFO> in scalar context, which gives you its iterator behavior.
Dave
In reply to Re: Out of memory error!!!
by davido
in thread Out of memory error!!!
by sathya83aa
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |