From: Charles Lane Date: Tue, 9 Oct 2001 08:40:57 +0000 (-0400) Subject: File::Find test on VMS X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ea05ec2d9411e82d008b2a0e92e7d66d6d9efb74;p=p5sagit%2Fp5-mst-13.2.git File::Find test on VMS Message-Id: <011009083426.17530f@DUPHY4.Physics.Drexel.Edu> p4raw-id: //depot/perl@12375 --- diff --git a/lib/File/Find/t/find.t b/lib/File/Find/t/find.t index 0dfd68c..5ec3dd7 100644 --- a/lib/File/Find/t/find.t +++ b/lib/File/Find/t/find.t @@ -18,16 +18,19 @@ BEGIN { if ( $symlink_exists ) { print "1..188\n"; } else { print "1..78\n"; } -use File::Find; -use File::Spec; -if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'VMS') - { - # This is a hack - at present File::Find does not produce native names on - # Win32 or VMS, so force File::Spec to use Unix names. - require File::Spec::Unix; - @File::Spec::ISA = 'File::Spec::Unix'; - } - +BEGIN { + use File::Spec; + if ($^O eq 'MSWin32' || $^O eq 'cygwin' || $^O eq 'VMS') + { + # This is a hack - at present File::Find does not produce native names on + # Win32 or VMS, so force File::Spec to use Unix names. + # must be set *before* importing File::Find + require File::Spec::Unix; + @File::Spec::ISA = 'File::Spec::Unix'; + } + require File::Find; + import File::Find; +} cleanup(); find({wanted => sub { print "ok 1\n" if $_ eq 'commonsense.t'; } },