in reply to Re: using File::Find for reading files in order
in thread using File::Find for reading files in order
In the find sub, $_ is equivalent to File::Find::name
Nope. $_ holds the name relative to the current directory at the time of the subroutine call, which in the default case has been chdir'ed to the location of the file. But $File::Find::name is always relative to the original directory.
So they aren't the same. Definitely different uses. You can use $_ inside the subroutine, but if you want to save the name for later, you want to use $File::Find::name. And in fact, it'd be wrong to use $File::Find::name within the subroutine, because your relative name would have been applied twice. Ouch.