in reply to Not writing to my local file.

Just a caveat that I have.. you do not need the quotes around your content variable.
This line:

print TMPFILE "$content";

should be
print TMPFILE $content;
Otherwise check you path to be very sure that it is absolute and correct
Anyway, no drug, not even alcohol, causes the fundamental ills of society. If we're looking for the source of our troubles, we shouldn't test people for drugs, we should test them for stupidity, ignorance, greed and love of power.

--P. J. O'Rourke