develooper Front page | perl.perl5.porters | Postings from February 2000

[PATCH 5.5.660]VMS Test::Harness fixup

From:
Dan Sugalski
Date:
February 29, 2000 09:17
Subject:
[PATCH 5.5.660]VMS Test::Harness fixup
Message ID:
Pine.LNX.4.10.10002291222550.27172-100000@tuatha.sidhe.org
VMS' 255-byte limit on %ENV entries messes up Test::Harness' setting
of PERL5LIB, which blows module testing right out of the water. The
following patch removes any @INC entry that has perl_root in it, which
shrinks PERL5LIB down small enough to be OK.

(perl_root, FWIW, is the root of the perl tree on VMS--presumably anything
in there will be automatically in @INC in the child, so we can safely toss
it)

--- lib/Test/Harness.pm;1	Sat Feb 26 05:57:12 2000
+++ lib/Test/Harness.pm	Tue Feb 29 12:09:31 2000
@@ -64,9 +64,14 @@
 
     # pass -I flags to children
     my $old5lib = $ENV{PERL5LIB};
-    local($ENV{'PERL5LIB'}) = join($Config{path_sep}, @INC);
 
-    if ($^O eq 'VMS') { $switches =~ s/-(\S*[A-Z]\S*)/"-$1"/g }
+    # VMS has a 255-byte limit on the length of %ENV entries, so
+    # toss the ones that involve perl_root, the install location
+    # for VMS
+    local($ENV{'PERL5LIB'}) = join($Config{path_sep}, grep {!/perl_root/i;} @INC) if $^O eq 'VMS';
+    local($ENV{'PERL5LIB'}) = join($Config{path_sep}, @INC) unless $^O eq 'VMS';
+
+    if ($^O eq 'VMS') { $switches =~ s/-(\S*[A-Z]\S*)/"-$1"/g;}
 
     my @dir_files = globdir $files_in_dir if defined $files_in_dir;
     my $t_start = new Benchmark;




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About