make return values from match in a list context, as well as $& et
[p5sagit/p5-mst-13.2.git] / t / pragma / warnings.t
index 73e4c8d..71fb0df 100644 (file)
@@ -76,7 +76,7 @@ for (@prgs){
     print TEST $prog,"\n";
     close TEST;
     my $results = $Is_VMS ?
-                  `MCR $^X $switch $tmpfile` :
+                  `./perl "-I../lib" $switch $tmpfile 2>&1` :
                  $Is_MSWin32 ?
                   `.\\perl -I../lib $switch $tmpfile 2>&1` :
                   `./perl -I../lib $switch $tmpfile 2>&1`;
@@ -88,8 +88,10 @@ for (@prgs){
 # bison says 'parse error' instead of 'syntax error',
 # various yaccs may or may not capitalize 'syntax'.
     $results =~ s/^(syntax|parse) error/syntax error/mig;
+    # allow all tests to run when there are leaks
+    $results =~ s/Scalars leaked: \d+\n//g;
     $expected =~ s/\n+$//;
-    my $prefix = ($results =~ s/^PREFIX\n//) ;
+    my $prefix = ($results =~ s#^PREFIX(\n|$)##) ;
     # any special options? (OPTIONS foo bar zap)
     my $option_regex = 0;
     if ($expected =~ s/^OPTIONS? (.+)\n//) {