From ea05ec2d9411e82d008b2a0e92e7d66d6d9efb74 Mon Sep 17 00:00:00 2001 From: Charles Lane Date: Tue, 9 Oct 2001 04:40:57 -0400 Subject: [PATCH] File::Find test on VMS Message-Id: <011009083426.17530f@DUPHY4.Physics.Drexel.Edu> p4raw-id: //depot/perl@12375 --- lib/File/Find/t/find.t | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/lib/File/Find/t/find.t b/lib/File/Find/t/find.t index 0dfd68caf8..5ec3dd7744 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'; } }, -- 2.34.1