I highly suggest getting the HTML out of your code and using templates instead. HTML::Template and Text::Template are among many available systems. Using templating has saved me many headaches in CGI/DBI programming.
yeah, I had considered a template... however this poll script is intended to be sitting within an index page, that has options down each side and has the vote script included via SSI.
Is it still ok to use templates given that the html I am printing is going to form merely a part of a much bigger html document ?