in reply to Re^2: Inserting Text into Files within a Directory
in thread Inserting Text into Files within a Directory

First of all, don't ask a new question by editing your previous one and replacing the text. It makes my above reply look completely irrelevant.

As for creating a temporary file, there are lots of ways to do it. One that might work for you is to just add an extention on the name of the existing file:

open(NEW,">$dir/$file.new") or die "Can't open $dir/$file.new: $!"

-b

Replies are listed 'Best First'.
Re^4: Inserting Text into Files within a Directory
by LF (Initiate) on Aug 24, 2004 at 16:04 UTC
    Sorry, I'm new at this..I just updated my entire post again(with new code, etc.). Should I just create a completely new post when updating my questions?
      Should I just create a completely new post when updating my questions?

      If the "update" is significantly different from your original question, then yes, it might be a good idea to start a whole new thread. If it's just a minor clarification, a reply will usually work. Either way, it's considered bad form to change a post without (1) leaving the original intact (though sometimes <strike> is used to indicate retracted parts), and (2) clearly indicating an update has occurred. See 'How do I change/delete my post?' for more explanation.