Thomas Bätzler <t.baetz...@bringe.com> writes:

> Harry Putnam <rea...@newsguy.com> 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: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to