Below is a working patch to magic.t, which gets all tests passing except:

----
# Use of uninitialized value in scalar assignment at [.op]magic.t line 244.

not ok 31
----

The code for that test looks like:

{
    local $SIG{'__WARN__'} = sub { print "# @_\nnot " };
    $! = undef;
    ok 1;
}

At L<perlvar/%SIG> I find, "The presence of a __WARN__ hook causes the 
ordinary printing of warnings to STDERR to be suppressed."  But that part 
works; the test just proceeds to print out the error after it has been 
trapped plus "not" with a newline prepended.  So the test would only make 
sense if the warning were never supposed to be generated in the first place, 
but I see no indications of such magic at L<perlvar/$!>.  What am I missing?

--- t/op/magic.t;-0     Mon Oct 15 08:33:36 2001
+++ t/op/magic.t        Tue Nov  6 17:10:35 2001
@@ -56,6 +56,7 @@
 # -- Nikola Knezevic
 if ($Is_MSWin32)  { ok `set FOO` =~ /^(FOO=)?hi there$/; }
 elsif ($Is_MacOS) { ok "1 # skipped", 1; }
+elsif ($Is_VMS)   { ok `write sys\$output f\$trnlnm("FOO")` eq "hi there\n"; }
 else              { ok `echo \$FOO` eq "hi there\n"; }
 
 unlink 'ajslkdfpqjsjfk';
@@ -64,7 +65,7 @@
 ok $!, $!;
 close FOO; # just mention it, squelch used-only-once
 
-if ($Is_MSWin32 || $Is_NetWare || $Is_Dos || $Is_MPE || $Is_MacOS) {
+if ($Is_MSWin32 || $Is_NetWare || $Is_Dos || $Is_MPE || $Is_MacOS | $Is_VMS) {
     skip('SIGINT not safe on this platform') for 1..2;
 }
 else {
@@ -153,7 +154,7 @@
     else {
        $wd = '.';
     }
-    my $perl = $Is_MacOS ? $^X : "$wd/perl";
+    my $perl = ($Is_MacOS || $Is_VMS) ? $^X : "$wd/perl";
     my $headmaybe = '';
     my $tailmaybe = '';
     $script = "$wd/show-shebang";
@@ -181,8 +182,8 @@
     elsif ($Is_MacOS) {
       $script = ":show-shebang";
     }
-    elsif ($Is_MacOS) {
-      $script = ":show-shebang";
+    elsif ($Is_VMS) {
+      $script = "[]show-shebang";
     }
     if ($^O eq 'os390' or $^O eq 'posix-bc' or $^O eq 'vmesa') {  # no shebang
        $headmaybe = <<EOH ;
@@ -199,7 +200,7 @@
 EOF
     ok close(SCRIPT), $!;
     ok chmod(0755, $script), $!;
-    $_ = $Is_MacOS ? `$perl $script` : `$script`;
+    $_ = ($Is_MacOS || $Is_VMS) ? `$perl $script` : `$script`;
     s/\.exe//i if $Is_Dos or $Is_Cygwin or $Is_os2;
     s{\bminiperl\b}{perl}; # so that test doesn't fail with miniperl
     s{is perl}{is $perl}; # for systems where $^X is only a basename



Reply via email to