perl -pi -e 'BEGIN { %s = map { $_ => [stat $_] } @ARGV} s/foo/bar/g; +END { for $f (keys %s) { utime(@{ $s{$f} }[8,9], $f) } }' [files]
In reply to in-place edit preserving file modification times by Your Mother
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |