in reply to slighly newbish question

According to your description, I am thinking the problem might be the other script you have, the one to add text to the end of the file, can you share that with us?
As you said, if you edit the file manually it is fine. I think this script should be fine, at least serves your purpose.

Replies are listed 'Best First'.
Re: Re: slighly newbish question
by Anonymous Monk on Nov 17, 2002 at 14:32 UTC
    the other script is very simple. it just adds a line based on a template file, then
    open (MSG, '>> messages.txt'); print MSG $mess_line; close MSG;
      Those three lines do not help debugging. Better to let us see how you form the $mess_line.
      By the way, you are appending to the end of the old file by sepcifying ">>", but I think that might be just what you want to do. Depends on what you have in the $mess_line, is it "new content only?", or "old+new"?
      Well, difficult to blind debug, give us even those what you thought trival.