Chris Devers wrote:
On Tue, 27 Dec 2005, Brano Gerzo wrote:
I am programming one script. It should be accessible as cgi-bin from web, and also as commandline from shell.

But I don't know how to properly handle arguments and to know, if script was called from commandline, or from web.

Anyone could help me ?


Probably.

Are you examining the %ENV hash ?

It will have hints as to how the script was invoked.


If the script is called via the web server, it probably does not have any arguments. It could also be invoked from different users. See `perldoc perlvar` and search for '$<' and '$>'.


--

Just my 0.00000002 million dollars worth,
   --- Shawn

* Perl tutorials at http://perlmonks.org/?node=Tutorials
* A searchable perldoc is available at http://perldoc.perl.org/

* Always write your code as though you aren't going to see it
* for another 25 years and then one day your boss comes up to you
* and says, "I want these changes and I want them yesterday!"

"Probability is now one. Any problems that are left are your own."
   SS Heart of Gold, _The Hitchhiker's Guide to the Galaxy_


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to