http://www.perlmonks.org?node_id=1882

vroom has asked for the wisdom of the Perl Monks concerning the following question: (files)

How do I append or write to the end of a file?

Originally posted as a Categorized Question.

  • Comment on How do I append or write to the end of a file?

Replies are listed 'Best First'.
Re: How do I append or write to the end of a file?
by Crulx (Monk) on Jan 21, 2000 at 04:59 UTC

    open FH, ">>$output_file" or die "Couldn't open file: $!";

    Opens a file for appending.

    In an already open file for writing,

    seek FH,0,2;

    After you get to the end via those methods, simply

    print FH "What you want to print\n";