Commit | Line | Data |
8d063cd8 |
1 | #!./perl -i.bak |
2 | |
a687059c |
3 | # $Header: io.inplace,v 3.0 89/10/18 15:26:25 lwall Locked $ |
8d063cd8 |
4 | |
5 | print "1..2\n"; |
6 | |
7 | @ARGV = ('.a','.b','.c'); |
8 | `echo foo | tee .a .b .c`; |
9 | while (<>) { |
10 | s/foo/bar/; |
11 | } |
12 | continue { |
13 | print; |
14 | } |
15 | |
16 | if (`cat .a .b .c` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";} |
17 | if (`cat .a.bak .b.bak .c.bak` eq "foo\nfoo\nfoo\n") {print "ok 2\n";} else {print "not ok 2\n";} |
18 | |
19 | unlink '.a', '.b', '.c', '.a.bak', '.b.bak', '.c.bak'; |