Write file using Perl