Also in Perl '>>' is used for appending stuff to a file:
#!/usr/local/bin/perl
use strict;
use warnings;
my $line1='ABCDEFGH';
my $line2='09876543';
open(OUT,">>mydata.dat") or die "Error: $!\n";
print OUT $line1 . "\n" . $line2 . "\n";
close(OUT);
---------- Post updated at 03:32 ---------- Previous update was at 03:26 ----------
Of course, if you already have a working Perl script which produces proper output, you could redirect the output to another file from the shell without modifying your existing Perl script, e.g. ./yourscript.pl >> filetoappend