in reply to use strict seems to hose my code

To parrot/sum up/paraphrase several of the above answers:

use CGI;

And dump the whole blinking block. You have copied a chunk of code that you exhibit not even the slightest understanding of and that is both bad practice and dangerous.