Here's one way to do it, although it is much more resource intensive to do it this way as opposed to simply appending the listing at the end:
$newdata = 'whatever';
local $/ = undef;
open(IN, "<$file");
$olddata = <IN>
close IN;
open(OUT, ">$file");
print $newdata."\n"
print $olddate;
close OUT;
|