There might be a work around, but I'm not sure, as I'm not in a position to test it right now. Try each of the following:
call CGI with ':no_debug' (to keep from entering the block that calls read_from_cmdline)
define the function 'CGI::read_from_cmdline' that doesn't actually read anything from the command line. (or put a wrapper around CGI, and put it in there)