in reply to One to one file output idiom
Hello Eily, I use Path::Tiny for almost all the file things.
$ rm foo* bar* $ echo foo > foo $ echo bar > bar
$ perl -MPath::Tiny -wnE 'sub baz {uc} chomp; my $in = path($_); $in-> +sibling("$_.new")->spew(baz($in->slurp));' foo bar
$ cat foo.new FOO $ cat bar.new BAR
Hope this helps!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: One to one file output idiom
by Eily (Monsignor) on Jan 16, 2020 at 09:20 UTC | |
by soonix (Chancellor) on Jan 16, 2020 at 10:04 UTC | |
by Eily (Monsignor) on Jan 16, 2020 at 10:08 UTC | |
by LanX (Saint) on Jan 16, 2020 at 21:19 UTC | |
by jdporter (Paladin) on Jan 17, 2020 at 03:11 UTC | |
by Your Mother (Archbishop) on Jan 17, 2020 at 16:31 UTC | |
by LanX (Saint) on Jan 17, 2020 at 04:33 UTC | |
| |
by LanX (Saint) on Jan 17, 2020 at 05:02 UTC | |
|