Luke Lu [off-list ref] wrote:
OK, let me try again :) I was using no_chdir => 1 to shorten the tr,
as well as saving a syscall. However the code is expecting $_ to be
relative elsewhere (line 1524) to check for the toplevel, so the
check failed for the toplevel because of no_chdir, which caused
substr to work on the toplevel, which is $pfxlen long. Note $pfxlen +
1 passes the end of the toplevel path, hence the errors, though the
program still worked correctly, as $subdir is undefined in this case,
which would by pass the rest of the code, which is logically correct.
It'll probably crash, if it's written in C :)
So, I got rid of no_chdir => 1 in the new patch and uses
$File::Find::name directly, as otherwise I'd have to come up with a
messier regex for checking toplevel at line 1524.
*light dawns*. Thank you for the explanation.
--
Shawn.