Dominic Mitchell wrote:

> 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";
> }


Thanks to everyone who helped.  I will dump all the $ENV variable see 
what I can see in the different cases.

Will.





-- 
*claw claw* *fang*
*shred* *rip* *ad hominem* *slash*
(more attacks will require consultancy fees.)
          -Nix.


Reply via email to