Finding the path of the perl script

 
Post new topic   Reply to topic    Aprelium Forum Index -> Perl
View previous topic :: View next topic  
Author Message
WebCarle
-


Joined: 10 Dec 2003
Posts: 3

PostPosted: Thu Dec 11, 2003 4:54 pm    Post subject: Finding the path of the perl script Reply with quote

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 View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Fri Dec 12, 2003 10:35 pm    Post subject: Re: Finding the path of the perl script Reply with quote

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 View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> Perl All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group