Click to See Complete Forum and Search --> : ENV variable


Ultimater
09-25-2005, 12:51 AM
In Perl, what is the ENV variable similar to PHP_SELF?

Would it return a string like:
http://www.aplustv.com/cgi-bin/perlfile.pl
or
/kunden/homepages/9/d114524627/htdocs/root/cgi-bin/perlfile.pl

Charles
09-25-2005, 07:25 AM
If you're using the CGI module it's self_url

Nedals
09-25-2005, 11:15 AM
Here's a list of the %ENV enviromentals and the expected return values.

http://www.devdaily.com/perl/edu/articles/pl020001.shtml

One point:
Not all of these work for all browser-server combinations

CyCo
09-25-2005, 11:59 AM
The CGI module is a plethora of specifics including the self_url (http://search.cpan.org/dist/CGI.pm/CGI.pm#CREATING_A_SELF-REFERENCING_URL_THAT_PRESERVES_STATE_INFORMATION:).

Ultimater
09-25-2005, 08:33 PM
self_url was giving me a string like:
http://www.mywebsite.net/cgi-bin/folder1/blah.pl/cgi-bin/folder1/blah.pl
Yes, that's no typo, it was actually printing the /cgi-bin/folder1/blah.pl part twice...
The url function gave me what I wanted though:
http://www.mywebsite.net/cgi-bin/folder1/blah.pl

Thanks guys for your help -- CyCo the link saved me!

CyCo
09-25-2005, 09:11 PM
Cool... :cool:
I love that module.