Well, make sure your file options are correct. I just pasted your code and generated some simple code around it to output to temp.html:
# open TEMP filehandle "temp.html" for appending/writing. open $TEMP, ">>temp.html" or die "temp.html not created."; #cut and pasted code printf $TEMP <<"_ENDOFTEXT_"; #other stuff <TABLE HEIGHT="100%" CELLSPACING="0" CELLPADDING="0" WIDTH="100%" BO +RDER="0"> #more stuff _ENDOFTEXT_ #close TEMP filehandle. close $TEMP;

It worked fine, and did not return any invalid hashes or any errors at all. Don't comment on the bad coding practice, I did this in a few seconds. It's more working pseudo-code than anything. I compiled it under Win32 with ActivePerl 5.6 and on Linux using Perl 5.6.0. I didn't try with 5.7.0.