Thomas Bätzler <[email protected]> writes:
> Harry Putnam <[email protected]> wrote:
>> I'm not finding a reference in perldoc File::Find showing how to set
>> that flag when using the popular notation like the script involved
>> here.
>
> Probably a case of not seeing the woods because of the trees ;-)
>
> To quote:
>
> NAME
> File::Find - Traverse a directory tree.
>
> SYNOPSIS
> use File::Find;
> find(\&wanted, @directories_to_search);
> sub wanted { ... }
>
> use File::Find;
> finddepth(\&wanted, @directories_to_search);
> sub wanted { ... }
>
> use File::Find;
> find({ wanted => \&process, follow => 1 }, '.');
> [...]
I pointed to that exact piece of code then asked how to make that
kind of options setting when using this format of find()
find(
sub {
if(bla){
blabla
}
},
@dir
);
Your proposed code
> find( {
> wanted => sub {
> print "$_\n";
> print "$File::Find::name\n";
> if ($lastfld eq $_) {
> print "<$lastfld> matches <$_>; Lets check the size:\n";
> my $size = (stat($File::Find::name))[7];
> print "$File::Find::name size: $size\n";
> }
> },
> no_chdir => 1,
> },
> $dir2
> );
doesn't do that.
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/