in reply to Outputting to browser vs DOS...how can you tell?
First, to output to the browser as soon as the information come from script, set the autoflush to on. This can be done with:
$| = 1;
To discover if the script is running from command line, an possible idea is testing the existance if any CGI environment variable, such as GATEWAY_INTERFACE.
if( defined $ENV{'GATEWAY_INTERFACE'} ) { # we are under CGI } else { # we are under command line }
Hope this helps
|
|---|