Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Lin Jingxian
May 9, 2005, 4:23 pm
rate this thread
Re: can I modify a file without using a temporary file
Lin Jingxian wrote:
> I want to modify contents of a file. usually I will open the
> file,read the contents,
> do some substitution, and write them to a temporary file, then delete
> the original file,
> rename the temporary file to the original file.
> now I want not to use a temporary file, can I do it in perl ?
Sure, just open() the file for read and write and then seek() to whereever
you want to write.
- » FAQ 5.22 All I want to do is append a small amount of text to the end of a file. Do I sti...
- — Previous thread in » PERL Discussions