You don't need to sort file each time you add entry.
just append the file.
open ( FH , "$file") or die 'can not open file' ;
@entries = (<FH>);
while($entry = pop(@entries) ){
.....you will get entries from bottom of the file .....
print $entry ,"\n";
}