develooper Front page | perl.vmsperl | Postings from January 2002

[PATCH @14417] vmsify Pod::Usage and its test

Thread Next
From:
Craig A. Berry
Date:
January 25, 2002 15:42
Subject:
[PATCH @14417] vmsify Pod::Usage and its test
Message ID:
5.1.0.14.2.20020125165829.031c0e70@exchi01
The patch below has a small tweak to Pod::Usage because colon and semicolon 
have special meaning within a path spec so cannot be used as a delimiter 
between path specs.  The exit status test in Usage.t has been modified to 
handle the posixified VMS exit status and parameter quoting has been added 
to the system() args.  I'm under the impression that double quotes around 
parameters work everywhere but if that's not true we'll have to special case 
this further.


--- lib/Pod/Usage.pm;-0 Thu Jan  3 10:49:15 2002
+++ lib/Pod/Usage.pm    Fri Jan 25 16:52:05 2002
@@ -478,7 +478,7 @@
     unless ((ref $opts{"-input"}) || (-e $opts{"-input"})) {
         my ($dirname, $basename) = ('', $opts{"-input"});
         my $pathsep = ($^O =~ /^(?:dos|os2|MSWin32)$/) ? ";"
-                            : (($^O eq 'MacOS') ? ',' :  ":");
+                            : (($^O eq 'MacOS' || $^O eq 'VMS') ? ',' :  ":");
         my $pathspec = $opts{"-pathlist"} || $ENV{PATH} || $ENV{PERL5LIB};
 
         my @paths = (ref $pathspec) ? @$pathspec : split($pathsep, $pathspec);
--- lib/Pod/t/Usage.t;-0        Sat Jan 19 13:00:19 2002
+++ lib/Pod/t/Usage.t   Fri Jan 25 17:13:50 2002
@@ -48,16 +48,16 @@
 }
 
 { # Test exit status from pod2usage()
-    my $exit = 42;
+    my $exit = ($^O eq 'VMS' ? 2 : 42);
     my $dev_null = File::Spec->devnull;
     my $args = join ", ", (
         "-verbose => 0", 
         "-exit    => $exit",
-        "-output  => q[$dev_null]",
-        "-input   => q[$0]",
+        "-output  => q{$dev_null}",
+        "-input   => q{$0}",
     );
-    my $prg = qq[pod2usage({ $args })];
-    my @cmd = ( $^X, '-I../lib',  '-MPod::Usage', '-e',  $prg );
+    my $prg = qq["pod2usage({ $args })"];
+    my @cmd = ( $^X, '-"I../lib"',  '-"MPod::Usage"', '-e',  $prg );
 
     is( system( @cmd ) >> 8, $exit, 'Exit status of pod2usage()' );
 }
[end of patch]


Thread Next


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