[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl-WebCGI] Out of Memory! Am I looping it "too far"?



You're using recursion. Recursion is like adding a second dimension to 
your looping. That will often eat more memory than you expect.

But it looks like you are being careful with your local variables. And it 
looks like you are being careful with the file handle so that it doesn't 
get clobbered by the recursion, too. So I assume you know about recursion.

Your do_exclude() function is only called from the main program. That 
probably isn't what you want? Perhaps you want to put your do_exclude() 
in your do_readsubdir() and then call do_readsubdir() from your main 
program instead of doing the readdir() in the main program?

I seem to recall someone saying that there is a package that recursively 
lists directories floating around. Here it is: 

<http://www.sial.org/code/perl/>

from the March macperl-webcgi lists.

Since I need to do this recursive directory descent myself, I'll play 
around with your code. But it'll be a couple of days.

rees_joel@fujicomp.co.jp
http://www.fujicomp.co.jp
http://www.udit.gr.jp


==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org