use Tie::File;

tie my @f,"Tie::File","demoFile";
my $t = localtime(); #get a human friendly version of the time
push(@f,$t); #add the time to the end of the file
unshift(@f,$t); #and ahead of the first line too
