in reply to perl CGI

CGI is a communication protocol using the environment variables, STDIN and STDOUT as communication channels. Perl knows nothing of CGI. While perl file.cgi (or any other extension) will execute, Perl won't populate the environment or STDIN appropriately.

But see the debugging section of CGI's documentation. A CGI environment can be faked.