in reply to Re^2: Using seek function to write out to top of file?
in thread Using seek function to write out to top of file?

You need to read perldoc -f open and perldoc perlopentut as it explains all of this. Opening with any form of > clobbers the output, and any form of >> opens in append mode. If you want to update in place you need to use +<.

--
We're looking for people in ATL

Replies are listed 'Best First'.
Re^4: Using seek function to write out to top of file?
by o2bwise (Scribe) on May 29, 2005 at 01:13 UTC
    fletch,

    I finally tried out +<. That worked. I mean, I wouldn't have done it that way, but it worked with what the class asked for, for a procedure (using seek (filehandle,0,0) and truncate (filehandle, tell(filehandle)).

    This was a good learning experience, albeit a very narrow one.

    Thanks,

    o2