Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: One to one file output idiom

by shmem (Chancellor)
on Jan 15, 2020 at 20:30 UTC ( [id://11111458]=note: print w/replies, xml ) Need Help??


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):

perl -p -e '$o ne $ARGV and open STDOUT,">","$ARGV.out" and $o = $ARGV +; s/perl6/raku/;' foo bar baz

When the input file changes ($ARGV), a new output file is opened. Of course, a file can be run instead of -e '$proggy'.

perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11111458]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-04-23 07:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found