buildtoc should use the correct path when looking for a .pm's .pod file.
authorNicholas Clark <nick@ccl4.org>
Sat, 17 Dec 2011 20:45:14 +0000 (21:45 +0100)
committerNicholas Clark <nick@ccl4.org>
Mon, 19 Dec 2011 12:55:18 +0000 (13:55 +0100)
This corrects commit be6d62867c9b925b, which attempted to avoid a warning
about lack of Pod in a .pm file if it had a corresponding .pod file.
However, the commit would never actually find the .pod file because it used
$File::Find::name as the basis for the search, instead of $_. This falls
foul of the same problem as described in the previous commit -
File::Find::find() changes directory, hence $File::Find::name points
somewhere bogus, whilst $_ contains the name to use.

With this change, pod/buildtoc no longer warns about the 20 relevant files.

pod/buildtoc

index b8a5482..25ff14a 100644 (file)
@@ -35,7 +35,7 @@ find(sub {
       return if $file =~ m!(?:^|/)t/!;
       return if $file =~ m!lib/Net/FTP/.+\.pm!; # Hi, Graham! :-)
       return if $file =~ m!XS/(?:APItest|Typemap)!;
-      my $pod = $file;
+      my $pod = $_;
       return if $pod =~ s/pm$/pod/ && -e $pod;
       open my $f, '<', $_ or my_die "Can't open file '$_': $!";
       {