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

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.

dmm

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://152406]
help
Chatterbox?
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
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?