in reply to Best way to write in Perl

It's not clear to me whether you want to append to the file b.txt or whether you want to overwrite it. See open for the various parameters you can pass to the open function to tell it what it should do to the file b.txt.

Replies are listed 'Best First'.
Re^2: Best way to write in Perl
by Anonymous Monk on Sep 04, 2007 at 06:45 UTC
    Hi,
    I want to over write data in a.txt.
    I am expecting output in a.txt as
    Thisisatestline Containsvalues TestingTestinginProgress Currently I am reading a.txt, store those data in an array. Then creating b.txt and replacing NULL and spaces from a.txt. Finally replacing a.txt by b.txt using mv command. Can you please provide best method to handle this?
    Thanks

      This doesn't sound too bad to me. Especially, your solution is safe from errors if your program crashes before the new output has been written completely. Why are you trying to change that?

        Thanks a lot for your help