Hi, use Path::Tiny and edit_lines().
Output:use strict; use warnings; use feature 'say'; use Path::Tiny; my $file = path('file.txt'); $file->spew("foo bar\nfoo bar"); $file->edit_lines(sub{s/bar/baz/}); say $file->slurp;
foo baz foo baz
Hope this helps!
In reply to Re: Avoid re-invocation for -pie processing
by 1nickt
in thread Avoid re-invocation for -pie processing
by seismofish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |