[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] the directory where the script is running



Chris Nandor wrote:

>Bart Lateur wrote:

>>If you want to know the path of the script on CGI, look at the
>>environmental variables. At least, I find, on Solaris+Apache that
>>$ENV{SCRIPT_FILENAME} contains the full path of script.
>>
>>You should test for yourself if your platform supports this, too.
>
>I believe it is SCRIPT_NAME.  That's what I get in all my web servers.

Both exist on my server. $ENV{SCRIPT_NAME} is the script's name,
relative to the webspace. $ENV{SCRIPT_FILENAME} is the script's name
relative to my server's filesystem. For example, the script "env.cgi"
(which tests the environment variables) is in the root on my webspace,
and the values for these environment variables are:

	SCRIPT_FILENAME 	/export/web/Customers/cdc/env.cgi
	SCRIPT_NAME     	/env.cgi

	Bart.

===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org