in reply to Add Contents At last in a File

You can just (assuming only adding at end) open the file for appending instead of clobbering /replcacing it:
open FILE, ">>", "d:\\swift\\file.tmp"; print FILE 'Add Some Text at last';; close FILE;
see perldoc -f open for details on the differnt MODE values.