http://qs1969.pair.com?node_id=516932


in reply to Out of Memory Error -- Possible Leak?

Although arguably more perlish than for, foreach has the downside of duplicating the entire set in memory before iterating through it. Converting the foreach to a for ( k=0; ...; ) construction would avoid that.

-M

Free your mind