From: Michael G. Schwern Date: Fri, 9 Nov 2001 00:41:56 +0000 (-0500) Subject: Helpful File::Find debugging code X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7dc9aaa56b11c3e04f31eb9de23451166e23126f;p=p5sagit%2Fp5-mst-13.2.git Helpful File::Find debugging code Message-Id: <20011109004156.L5587@blackrider> p4raw-id: //depot/perl@12910 --- diff --git a/lib/File/Find/t/find.t b/lib/File/Find/t/find.t index 682d233..823c7b1 100644 --- a/lib/File/Find/t/find.t +++ b/lib/File/Find/t/find.t @@ -18,6 +18,23 @@ BEGIN { if ( $symlink_exists ) { print "1..188\n"; } else { print "1..78\n"; } +# Uncomment this to see where File::Find is chdir'ing to. Helpful for +# debugging its little jaunts around the filesystem. +# BEGIN { +# use Cwd; +# *CORE::GLOBAL::chdir = sub ($) { +# my($file, $line) = (caller)[1,2]; +# +# printf "# cwd: %s\n", cwd(); +# print "# chdir: @_ from $file at $line\n"; +# my($return) = CORE::chdir($_[0]); +# printf "# newcwd: %s\n", cwd(); +# +# return $return; +# }; +# } + + BEGIN { use File::Spec; if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'VMS') @@ -60,7 +77,7 @@ sub cleanup { rmdir dir_path('fa'); rmdir dir_path('fb', 'fba'); rmdir dir_path('fb'); - chdir File::Spec->updir; + chdir(File::Spec->updir); rmdir dir_path('for_find'); } }