Hi,

There should be many ENV that would only be set if you are using a browser, but
one of them might be HTTP_USER_AGENT. 
Here is a tested example :

#----
if($ENV{'HTTP_USER_AGENT'}) {
  print "Content-type: text/html\n\n";
  print " You are using a browser";
}
else { print "You have started this script from the command prompt \n"; }
#----

Good luck !!

Regs David
-----------------
 
> Hi,
> 
> I thought of another way possibly...of doing this.
> 
> Is there a way through environment variables (or someother way) to check to 
> see if the perl script is being run via command prompt or from a browser 
> (web interface)?
> 
> This way if someone runs the script from a command prompt I output it to 
> the screen using >CON: and if its run from a web browser then I redirect it 
> to a file and then read that file to the browser after completion 
> using >output.txt".
> 
> Please say yes...and how?
> 
> 
> 
> 
> 
>+-----------------------------------------------------------------------------------+ 
> 
> Philip Humeniuk
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> 
>+------------------------------------------------------------------------------------+
> 
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to