in reply to cgi form and javascript

There is nothing in your 'print' lines that needs to be interpolated, you could just change for example:
print "<html><head><script="javascript" src="demo.js"</script><title>T +ESTING</title></head>";
to
print '<html><head><script="javascript" src="demo.js"</script><title>T +ESTING</title></head>';
Not sure if this is your issue, but you have unescaped "s in the line.