Fix VMS exit handling broken in Test::Harness 2.64. Also
Craig A. Berry [Wed, 21 Feb 2007 01:55:37 +0000 (01:55 +0000)]
submitted as http://rt.cpan.org/Public/Bug/Display.html?id=24985
on CPAN RT queue.

p4raw-id: //depot/perl@30373

lib/Test/Harness/Results.pm
lib/Test/Harness/Straps.pm

index f972fdd..f4f4c4e 100644 (file)
@@ -118,7 +118,18 @@ sub ok {
     return $self->{ok} || 0;
 }
 
-sub set_exit { my $self = shift; $self->{exit} = shift }
+sub set_exit { 
+    my $self = shift; 
+    if ($^O eq 'VMS') {
+        eval {
+            use vmsish q(status);
+            $self->{exit} = shift;  # must be in same scope as pragma
+        }
+    }
+    else {
+        $self->{exit} = shift;
+    }
+}
 sub exit {
     my $self = shift;
     return $self->{exit} || 0;
index 5a88e14..bab7266 100644 (file)
@@ -296,7 +296,7 @@ sub analyze_file {
 
     $results->set_wait($?);
     if ( $? && $self->{_is_vms} ) {
-        eval q{use vmsish "status"; $results->set_exit($?); };
+        $results->set_exit($?);
     }
     else {
         $results->set_exit( _wait2exit($?) );