View previous topic :: View next topic |
Author |
Message |
WebCarle -
Joined: 10 Dec 2003 Posts: 3
|
Posted: Thu Dec 11, 2003 4:54 pm Post subject: Finding the path of the perl script |
|
|
With this kind of script:
$path=$0;
$script_name=$_[0];
print "Path is $0 and script_name is $script_name";
In normal case (example with IIS on Win32 machine)
I get the complete path of my script:
the result of this script is for example:
Path is C:\myfolder\myscript.pl and script_name is myscript.pl
but on AWS the result of this script is :
Path is myscript.pl and script_name is myscript.pl
So i cant find dynamicaly the complete path of my script !
Ihave installed Abyss on my notebook to working but i cant modify
all time my scripts to work on IIS (when they are ready)
and work on AWS when i develop or modify it!
Any idea to solve this problem? |
|
Back to top |
|
|
aprelium -
Joined: 22 Mar 2002 Posts: 6800
|
Posted: Fri Dec 12, 2003 10:35 pm Post subject: Re: Finding the path of the perl script |
|
|
WebCarle,
By using the code you cited, you're relying on a specific server beahvior (and as you can see, Abyss doesn't seem to have the same paths conventions).
The better is to use the exported environment variables according to the CGI specification. Your full script path is in $ENV{'SCRIPT_FILENAME'}.
The list of the exported CGI environment variables is available in Abyss user's guide (CGI chapter). _________________ Support Team
Aprelium - http://www.aprelium.com |
|
Back to top |
|
|
|