in reply to append text to a file

Perl and the format command have no knowledge of what is already in the file, it does not magically remember that you already added a heading, it assumes you are running from the start.

You need to keep a record of the line count yourself somewhere, either in this file or another, or read the whole file each time to figure out what $- should be.

Replies are listed 'Best First'.
Re^2: append text to a file
by mhoang (Acolyte) on Aug 08, 2011 at 00:35 UTC
    Thank u. Got it !