summaryrefslogtreecommitdiff
path: root/pod/buildtoc
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-12-18 17:37:20 +0100
committerNicholas Clark <nick@ccl4.org>2011-12-19 13:55:19 +0100
commit45ea9a6e0d15cab8408cc6c9c7292e8efd67db77 (patch)
tree93e61784a63a3d88bebbd05b3f4321f20482aa61 /pod/buildtoc
parent3a527656fd7999878fb0ad4e500f5c44148c5bd2 (diff)
downloadperl-45ea9a6e0d15cab8408cc6c9c7292e8efd67db77.tar.gz
In buildtoc, pass 'no_chdir' to File::Find::find().
Diffstat (limited to 'pod/buildtoc')
-rw-r--r--pod/buildtoc24
1 files changed, 12 insertions, 12 deletions
diff --git a/pod/buildtoc b/pod/buildtoc
index e35dcc412e..5fcb938985 100644
--- a/pod/buildtoc
+++ b/pod/buildtoc
@@ -25,18 +25,18 @@ my $state = get_pod_metadata(0, sub { warn @_ if @_ }, 'pod/perltoc.pod');
# Find all the modules
my @modpods;
-find(sub {
- if (/\.p(od|m)$/) {
- my $file = $File::Find::name;
- return if $file =~ qr!/Pod/Functions.pm\z!; # Used only by pod itself
- return if $file =~ m!(?:^|/)t/!;
- return if $file =~ m!lib/Net/FTP/.+\.pm!; # Hi, Graham! :-)
- return if $file =~ m!XS/(?:APItest|Typemap)!;
- my $pod = $_;
- return if $pod =~ s/pm$/pod/ && -e $pod;
- push @modpods, $file;
- }
- }, 'lib');
+find({no_chdir => 1,
+ wanted => sub {
+ if (/\.p(od|m)$/) {
+ return if m!/Pod/Functions.pm\z!; # Used only by pod itself
+ return if m!(?:^|/)t/!;
+ return if m!lib/Net/FTP/.+\.pm!; # Hi, Graham! :-)
+ return if m!XS/(?:APItest|Typemap)!;
+ my $pod = $_;
+ return if $pod =~ s/pm$/pod/ && -e $pod;
+ push @modpods, $_;
+ }
+ }}, 'lib');
my_die "Can't find any pods!\n" unless @modpods;