in reply to out of memory problem

If it is really O(n^n) and n is anything greater than about 10, then you are stuffed.

Describe what you are trying to achieve and show us the guts of the code with a very small sample set. We may be able to advise on a better technique than you are currently using. Consider this thread as an example of how a different approach can help.


DWIM is Perl's answer to Gödel