in reply to "Out Of Memory" error

I wonder if you might be running out of C stack space. I believe glob builds all the results up front, even if you use the iterator form. The solution would be to write an alternative to glob that generates the results one at a time or an alternative that generates the results in Perl memory rather than on the C stack.