go ahead... be a heretic | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
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
|
|