in reply to an error with my perl cgi code

That code line looks fine, but you may need to import some of the CGI module's extra functions using use CGI ':all';

just another cpan module author