Allow negative indexing in recursive patterns
[p5sagit/p5-mst-13.2.git] / t / op / magic.t
index 134d049..294beb0 100755 (executable)
@@ -49,10 +49,11 @@ $Is_MPE      = $^O eq 'mpeix';
 $Is_miniperl = $ENV{PERL_CORE_MINITEST};
 $Is_BeOS     = $^O eq 'beos';
 
-$PERL = ($Is_NetWare            ? 'perl'   :
-        ($Is_MacOS || $Is_VMS) ? $^X      :
-        $Is_MSWin32            ? '.\perl' :
-        './perl');
+$PERL = $ENV{PERL}
+    || ($Is_NetWare           ? 'perl'   :
+       ($Is_MacOS || $Is_VMS) ? $^X      :
+       $Is_MSWin32            ? '.\perl' :
+       './perl');
 
 eval '$ENV{"FOO"} = "hi there";';      # check that ENV is inited inside eval
 # cmd.exe will echo 'variable=value' but 4nt will echo just the value
@@ -256,7 +257,7 @@ EOF
     s{\\}{/}g;
     ok((($Is_MSWin32 || $Is_os2) ? uc($_) eq uc($s1) : $_ eq $s1), " :$_:!=:$s1:");
     $_ = `$perl $script`;
-    s/\.exe//i if $Is_Dos or $Is_os2;
+    s/\.exe//i if $Is_Dos or $Is_os2 or $Is_Cygwin;
     s{./$perl}{$perl} if $Is_BeOS; # revert BeOS execvp() side-effect
     s{\\}{/}g;
     ok((($Is_MSWin32 || $Is_os2) ? uc($_) eq uc($s1) : $_ eq $s1), " :$_:!=:$s1: after `$perl $script`");
@@ -436,7 +437,7 @@ ok "@+" eq "10 1 6 10";
 }
 
 # Test for bug [perl #36434]
-{
+if (!$Is_VMS) {
     local @ISA;
     local %ENV;
     eval { push @ISA, __PACKAGE__ };
@@ -449,3 +450,9 @@ ok "@+" eq "10 1 6 10";
     ok( $@ eq '', 'Assign a shared key to a magic hash');
     $@ and print "# $@";
 }
+else {
+# Can not do this test on VMS, EPOC, and SYMBIAN according to comments
+# in mg.c/Perl_magic_clear_all_env()
+#
+    skip('Can\'t make assignment to \%ENV on this system') for 1..3;
+}