#!/usr/bin/perl use strict; use warnings; use CGI::Fast qw(:standard); sub mode { my $h=$CGI::Fast::Ext_Request; if (defined($h) && ref($h) && $h->IsFastCGI()) { return 'FastCGI'; } else { return 'CGI'; } } while (CGI::Fast->new()) { print header(), start_html('CGI or FastCGI?'), h1('CGI or FastCGI?'), p('This application runs in ',mode(),' mode.'), end_html(); }