Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

Re: files

by dmmiller2k (Chaplain)
on Mar 18, 2002 at 05:10 UTC ( #152406=note: print w/replies, xml ) Need Help??

in reply to Changing a file?

Regrettably, this is a problem in any language, not necessarily restricted to Perl.

The short answer is, "it depends."

A slightly longer answer is, "read in the file, make approporate changes in memory, and write to a new file, then rename both files when you're done." This approach presumes much about the type of file, what kind of changes you're making, how big the file is, and how much of it you're changing (also where in the file). There are an effectively infinite number of things you might be using the file for and ways you might be using it.

A better anwer to your specific question would be contingent upon more details, including (of course) a code snippet of what you already have done.


If you GIVE a man a fish you feed him for a day
TEACH him to fish and you feed him for a lifetime

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2023-09-26 21:37 GMT
Find Nodes?
    Voting Booth?

    No recent polls found