Alright, there may be a very simple answer to this question that I have missed, but here goes...
I'm writing a perl script that needs to provide a number of different interfaces (e-mail wrapper, CGI, and command line namely). What I need to know is how the script was run. Was it called as an e-mail wrapper, CGI script, from the command line?
I know that I can check on the existance of certain %ENV keys, but I'm not certain how portable or reliable some of those are. Is $ENV{LOGNAME} only set for e-mail wrappers running under Linux with sendmail? Will that same one exist on SunOS running Postfix? Questions like these trouble me, and I cannot answer them.
Is there a better way than checking %ENV and hoping that these are reliable on 'x' OS with 'y' mail server or 'z' web server? ;-)
(Also, before someone suggests it, I know I can just have the bulk of the code in an external module and then have small script-shells that are specific for each interface. I'm just trying to avoid that because I ultimately don't know what interfaces I will finally choose on using for this particular script)
In reply to How was my script ran? by criswell
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |