#!./perl

$^I = '.bak';

# $RCSfile: inplace.ntt,v $$Revision: 1.1 $$Date: 1996/10/12 21:06:50 $
# revised for NT 95/04/07

print "1..2\n";

@ARGV = ('a','b','c');

foreach (@ARGV) {
    open(TMP, '>' . $_ ) || warn $!;
    print TMP "foo\n";
    close TMP;
}

while (<>) {
    s/foo/bar/;
}

continue {
    print;
}

if (`type a`.`type b`.`type c` eq "bar\nbar\nbar\n") {print "ok 1\n";} else {print "not ok 1\n";}

if (`type a.bak`.` type b.bak`.`type c.bak`  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';
