write to file using perl