in reply to RE: file::find
in thread file::find

Alternately, use a hashref as the first argument to find() and set the no_chdir option. find {wanted => \&wanted, no_chdir => 1}, '/dir'; Then, no chdir is done; and $_ will be the same as $File::Find::name.

Replies are listed 'Best First'.
Re: RE: RE: file::find
by OzzyOsbourne (Chaplain) on Mar 30, 2001 at 01:46 UTC
    I know this is an old post, but the only documentation I found on this was to go into the module and read. There are a few flags in there that aren't mentioned in the documentation

    I don't know if your code works, b/c of the missing parens, but I use:

    find ({wanted => \&wanted, no_chdir=>1}, $dir1);

    -OzzyOsbourne

RE: RE: RE: file::find
by mikfire (Deacon) on May 01, 2000 at 23:47 UTC
    Where is that documented? I have looked for that flag for ages. What version? A quick grep of my perl5.005_03 sources do not turn up this flag. Ah. I see. That would be new to perl 5.6.0. Cool! I can stop implementing my own Find. Thanks!

    Mik
    Mik Firestone ( perlus bigotus maximus )

      Whoops. Forgot that was new for 5.6. I knew there was a reason I hadn't used that flag on a production server.