in reply to One to one file output idiom
Just open a new file whenever the current $ARGV isn't the same as the remembered one (which can be undefined):
When the input file changes ($ARGV), a new output file is opened. Of course, a file can be run instead of -e '$proggy'.perl -p -e '$o ne $ARGV and open STDOUT,">","$ARGV.out" and $o = $ARGV +; s/perl6/raku/;' foo bar baz
perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
|
---|
In Section
Seekers of Perl Wisdom