Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Your favourite gory detail...

by ysth (Canon)
on Jun 23, 2004 at 06:18 UTC ( [id://368950]=note: print w/replies, xml ) Need Help??


in reply to Re: Your favourite gory detail...
in thread Your favourite gory detail...

It does even more if you are using the -i flag.

Update: to be more explicit, under -i, a simple eof() will (if needed) pull the next file(s) off of @ARGV, renaming and creating a new file for each until it gets to a non-empty one, and then selects that one as the default output file:

$ rm foo{.bak,};echo bar>foo;perl -i.bak -we'sub show { print STDOUT " +files: ", join(",", glob("*")), "\nselected: $_\n" and select $_ for select *{" +TEMP"} } show; print STDOUT eof() ? "eof\n" : "not eof\n"; show' foo files: foo selected: main::STDOUT not eof files: foo,foo.bak selected: main::ARGVOUT

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-29 15:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found