Inspired by a post asking how to get xargs-like functionality on windows, I uncovered a couple of idioms to use with in-place editing but reading the names from STDIN. This is useful when your inplace edit is the tail-end of a find ... -print or more securely a find ... -print0.
## for -print (or ls or other newline-delimited names) find ... -print | perl -pi.bak -e 'BEGIN { chomp(@ARGV = <STDIN>) } s/ +foo/bar/g' ## for -print0 (safer when names may contain newline) find ... -print0 | perl -pi.bak -e 'BEGIN { local $/ = "\0"; chomp(@AR +GV = <STDIN>) } s/foo/bar/g'