in reply to File::Find on Win32 - basic problem/question

The File::Find docs for the version shipped with Perl 5.8 say

$dont_use_nlink

You shouldn't need to set this variable, since File::Find should now detect such file systems on-the-fly and switch itself to using stat. This works even for parts of your file system, like a mounted CD-ROM.

You probably want to make your regex case insensitive, as well.

At any rate, the point is that your wanted function's return value is completely irrelevant to File::Find. $File::Find::name's value after find terminates is not defined either. You have to use your wanted function to store the name, if you want to do so. Something like

my $found; sub wanted { $found = $File::Find::name if /^eudora\.ini\z/i; }
You could also try File::Find::Rules which has a much nicer interface for simple cases.
my ($found) = File::Find::Rule ->file ->name('eudora.ini') ->in('C:\\');

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re: File::Find on Win32 - basic problem/question
by mabman (Novice) on Oct 02, 2003 at 21:35 UTC
    OK, thanks, that's clear now. I'm looking into File::Find::Rule, it seems to do what I need it to.

    Thanks,
    Glenn