If Apache is available, you can use
Apache-Test
for testing cgi scripts. An example is in the
libapreq2 distribution - see the
glue/perl/t/apreq/cgi.t file for the test itself, and
glue/perl/t/conf/extra.conf.in for the needed Apache configuration directives.