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 command line arguments and
I'm also not sure whether there could sometimes be arguments in
@ARGV when called through CGI?
Is there a better way to check?
The proper way would be
use constant RUNNING_AS_CGI => exists $ENV{GATEWAY_INTERFACE};
-- fxn
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/