This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Comment nit by Vadim Konovalov
[perl5.git] / t / io / inplace.t
index 2652c8b..a97add5 100755 (executable)
@@ -1,6 +1,6 @@
 #!./perl
 
-$^I = '.bak';
+$^I = $^O eq 'VMS' ? '_bak' : '.bak';
 
 # $RCSfile: inplace.t,v $$Revision: 4.1 $$Date: 92/08/07 18:27:29 $
 
@@ -13,6 +13,24 @@ if ($^O eq 'MSWin32') {
   `.\\perl -le "print 'foo'" > .b`;
   `.\\perl -le "print 'foo'" > .c`;
 }
+elsif ($^O eq 'NetWare') {
+  $CAT = 'perl -e "print<>"';
+  `perl -le "print 'foo'" > .a`;
+  `perl -le "print 'foo'" > .b`;
+  `perl -le "print 'foo'" > .c`;
+}
+elsif ($^O eq 'MacOS') {
+  $CAT = "$^X -e \"print<>\"";
+  `$^X -le "print 'foo'" > .a`;
+  `$^X -le "print 'foo'" > .b`;
+  `$^X -le "print 'foo'" > .c`;
+}
+elsif ($^O eq 'VMS') {
+  $CAT = 'MCR []perl. -e "print<>"';
+  `MCR []perl. -le "print 'foo'" > ./.a`;
+  `MCR []perl. -le "print 'foo'" > ./.b`;
+  `MCR []perl. -le "print 'foo'" > ./.c`;
+}
 else {
   $CAT = 'cat';
   `echo foo | tee .a .b .c`;
@@ -25,6 +43,6 @@ continue {
 }
 
 if (`$CAT .a .b .c` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";}
-if (`$CAT .a.bak .b.bak .c.bak` eq "foo\nfoo\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
+if (`$CAT .a$^I .b$^I .c$^I` eq "foo\nfoo\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";}
 
-unlink '.a', '.b', '.c', '.a.bak', '.b.bak', '.c.bak';
+unlink '.a', '.b', '.c', ".a$^I", ".b$^I", ".c$^I";