in reply to Writing to a File
When you are checking whether it worked are you opening c:\temp\testtmp.tmp in a text editor, or reading it with a perl script?