This sounds a lot like what would happen if you had read STDIN already before calling new CGI(). If you just want to create a CGI object without it trying to automatically read the script's input, you can initialize it with an empty string: new CGI("").