The path to you script is held in the environment variable SCRIPT_FILENAME. Here is a short script that will display all the variables. You can save the code as enpath.pl and put it in your cgi-bin, this is how you call it. From your browser type:
http://www.yourdomain.com/cgi-bin/enpath.pl
PHP Code:
#!/usr/bin/perl
use CGI;
$co = new CGI;
print
$co->header,
$co->start_html('CGI Environment Variables Example'),
$co->center($co->h1('CGI Evironment Variables Example'));
foreach $key (sort keys %ENV) {
print $co->b("$key=>$ENV{$key}"),
$co->br;
}
print $co->end-html;
This should help you get the correct path..