blm has asked for the wisdom of the Perl Monks concerning the following question:
I was always told not to alter the files and directory structure when doing a File::Find. So I do a find pushing the results into a list then after the find is complete I perform my action on the files. Is this silly? The code structure that I use is as follows:
my @file_list; my $file; my $path = "/home/blm/url/"; find (\&wanted, $path); foreach $file (@file_list) { ... } sub wanted{ if (-f) { push @file_list, $_; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Shouldn't modify file or directory structure when in File::Find?
by Zaxo (Archbishop) on Sep 17, 2002 at 23:25 UTC | |
|
Re: Shouldn't modify file or directory structure when in File::Find?
by PodMaster (Abbot) on Sep 18, 2002 at 02:57 UTC |