home *** CD-ROM | disk | FTP | other *** search
- #!./perl
-
- $^I = '.bak';
-
- # $Header: inplace.t,v 4.0 91/03/20 01:50:59 lwall Locked $
-
- print "1..2\n";
-
- @ARGV = ('a','b','c');
-
- foreach (@ARGV) {
- open(tmp, ">$_");
- print tmp "foo\n";
- close(tmp);
- }
-
- while (<>) {
- s/foo/bar/;
- }
- continue {
- print;
- }
-
- if (`type a b c 2>nul:` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";}
-
- if (`type a.bak b.bak c.bak 2>nul:` 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';
-