in reply to Best way to write in Perl

A pet peeve of mine: please don't do this:
system("mv b.txt a.txt");
because it creates an unwanted child. Use rename instead:
rename('b.txt', 'a.txt');