Perl updating a file in place