Another guess: in the first working example, you use file "T:\temp.txt", while in the not-working one you use "T:\temp\temp.txt". Are you sure that directory "T:\temp" exists in drive T, and you have the rights to write it?!?
Flavio (perl -e 'print(scalar(reverse("\nti.xittelop\@oivalf")))')
Don't fool yourself.