in reply to Syntax errors galore, need a good debugging

Assuming that perhaps you haven't fixed this yet... My editor seems to prefer the following:
qq(<SCRIPT LANGUAGE="JavaScript">), Tr( td(), td(submit), td("document.write('<form><input type=button value=\"Refresh\" onC +lick=\"history.go()\"></form>)" ), ), end_form(), hr(), qq(</script>) ); print "(<a href=\"log.pl\" target=\"new\">chat logs</a>)";