5 $^I = $^O eq 'VMS' ? '_bak' : '.bak';
9 my @tfiles = (tempfile(), tempfile(), tempfile());
10 my @tfiles_bak = map "$_$^I", @tfiles;
12 END { unlink_all(@tfiles_bak); }
14 for my $file (@tfiles) {
15 runperl( prog => 'print qq(foo\n);',
16 args => ['>', $file] );
28 is ( runperl( prog => 'print<>;', args => \@tfiles ),
30 "file contents properly replaced" );
32 is ( runperl( prog => 'print<>;', args => \@tfiles_bak ),
34 "backup file contents stay the same" );