Re: Detecting whether a script was called via CGI or the command line

2007-05-04 Thread Xavier Noria
On May 4, 2007, at 2:44 PM, Nigel Peck wrote: Within the script I want to know where it was executed from; CGI or command line/cron job. I'm currently checking @ARGV to do this i.e. if there is data in @ARGV then it was called from the command line, but obviously this means there must be co

Detecting whether a script was called via CGI or the command line

2007-05-04 Thread Nigel Peck
Hi, I have a script which is usually run through CGI, but I want to set it up to be executed by a cron job each day too. Within the script I want to know where it was executed from; CGI or command line/cron job. I'm currently checking @ARGV to do this i.e. if there is data in @ARGV then it