$ perl -MPath::Tiny -wnE 'sub baz {uc} chomp; my $in = path($_); $in->sibling("$_.new")->spew(baz($in->slurp));' foo bar