in reply to Re: opendir in file find
in thread opendir in file find
You can save a little overhead by reusing the stat buffer using the magical filehandle '_',
"doh! can't read directory $file!\n" if (-d $file and not -r _);
In the case of File::Find, they guarentee that lstat will have been called before the wanted sub is called, so rather than
sub wanted{ print $File::Find::name if -d $_ and $r $_; }
you can use
sub wanted{ print $File::Find::name if -d _ and -r _; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: opendir in file find (anti-optimization effects)
by tye (Sage) on Jul 25, 2003 at 17:36 UTC | |
by BrowserUk (Patriarch) on Jul 25, 2003 at 18:11 UTC | |
by tye (Sage) on Jul 25, 2003 at 18:21 UTC | |
by BrowserUk (Patriarch) on Jul 25, 2003 at 19:14 UTC | |
|
Re: Re: Re: opendir in file find
by skyknight (Hermit) on Jul 25, 2003 at 17:28 UTC |