- next if $s eq $orig;
- seek($fh, 0, SEEK_SET) or die "seek: $!";
- truncate($fh, 0) or die "truncate: $!";
- print $fh $s or die "print: $!";
- close $fh or die "close: $!";
+ if ($s eq $orig) {
+ my $t = time;
+ utime($t, $t, $fh);
+ } else {
+ seek($fh, 0, SEEK_SET) or die "seek: $!";
+ truncate($fh, 0) or die "truncate: $!";
+ print $fh $s or die "print: $!";
+ close $fh or die "close: $!";
+ }