in reply to Writing to files

I've got a program online that does insertion into a file ( But the bigger question is, WHY DO YOU NEED TO DO THIS? Observe:
open FILE, ">>data" or die "can't append to data: $!"; print FILE "NEW RECORD\n"; close FILE; # now, to store the file's contents in an array, MOST # RECENT DATA FIRST, use unshift instead of push! open FILE, "data" or die "you know the drill... $!"; unshift @contents, $_ while <FILE>; close FILE;