Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

(tye)Re: The easiest way to substitute a part of the content of a file.

by tye (Sage)
on Jan 03, 2001 at 07:04 UTC ( #49446=note: print w/replies, xml ) Need Help??


in reply to Re: Re: The easiest way to substitute a part of the content of a file.
in thread The easiest way to substitute a part of the content of a file.

That is roughtly what tilly's "perl -pi" solution does. And I would discourage rewriting the existing file without renaming, that way lies nasty race conditions. Best to write a new file and rename it into place after you are done (you still have a race condition if you have simultaneious writers, but are in good shape in the more common case of a single writer and any number of readers).

        - tye (but my friends call me "Tye")
  • Comment on (tye)Re: The easiest way to substitute a part of the content of a file.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2021-04-11 16:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?