if (exists $ENV{'GATEWAY_INTERFACE'}) { # invoked as CGI # print out a short message and abort my $q=CGI->new(); print $q->header(-status=>'400 Bad Request', -type=>'text/html'), $q->start_html(-title=>'Bad Request'), $q->h1('Bad Request'), $q->end_html(); exit 0; } # not invoked as CGI if you get here #### $ENV{PATH} = "/usr/sbin/sendmail -t -i"; #for sendmail