Commit | Line | Data |
---|---|---|
8d063cd8 | 1 | #!./perl -i.bak |
2 | ||
3 | # $Header: io.inplace,v 1.0 87/12/18 13:12:51 root Exp $ | |
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'; |