in reply to passing argument to sub wanted
Or... Don't try to do everything inside of your wanted(). Just have wanted() build your array of filenames then iterate over the list, outside of find(), to do the pruning. Performance is not impacted as your runtime is totally dominated by disk access.
my @filelist; find ( \&callback, @directories ); sub callback { ... push @filelist, $_; } # Prune the list my @somefiles = grep { some_code } @filelist;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: passing argument to sub wanted
by Jenda (Abbot) on May 21, 2008 at 02:01 UTC |