nemesis <[EMAIL PROTECTED]> writes:

> Anyone know of a way of telling whether a perl script was called as a
> CGI (via the apache webserver) or directly (as in as a cron script or
> command line)?

if (exists $ENV{SERVER_NAME}) {
        print "I'm a cgi (probably)\n";
} else {
        print "I don't appear to be a cgi\n";
}

-Dom

-- 
| Semantico: creators of major online resources          |
|       URL: http://www.semantico.com/                   |
|       Tel: +44 (1273) 722222                           |
|   Address: 33 Bond St., Brighton, Sussex, BN1 1RD, UK. |

Reply via email to