in reply to Re^2: process array with while loop
in thread process array with while loop
Just thought I would point that out. for basically makes an in-memory copy of the list when it first starts.#This code not tested my @dirs = '.'; while(my $dir = shift @dirs) { opendir(DIR,$dir); while(my $entry = readdir(DIR)) { if(-d $entry) { push @dirs, "$dir/$entry"; } else { #do something for files/links etc } } closedir(DIR); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: process array with while loop
by ikegami (Patriarch) on Nov 09, 2006 at 18:46 UTC |