in reply to CGI + safeguards

You should consider using CGI::Safe