http://www.perlmonks.org?node_id=1062818


in reply to Re^2: Perl Program - Out of memory?
in thread Perl Program - Out of memory?

You have "foreach" loops 10 deep in that program. If each one runs only 3 times, that's 60,000 iterations of the inner loop. I would seriously consider rethinking what you're trying to do, or how you're doing it, because an O(n^10) algorithm is usually a recipe for disaster.