How to detect inside Perl script if it is called under FCGI or CGI. I want to detect if running under FCGI then load the FCGI modules, something like this at the top of the script:
if ($ENV{FCGI}) {
use FCGI;
use MyFCGIHandler;
}
I know I can do something like this:
use FCGI;
my $request = FCGI::Request();
#Returns whether or not the program was run as a FastCGI.
$isfcgi = $req->IsFastCGI();
But this means I have to load the FCGI module and call its Request and isFastCGI methods to check which is not good if app is not running under FCGI.