in reply to Using FindBin or CWD from within a CGI program

If you're writing this in a CGI script, (ie, putting it on the net), There's an ENV hash available through CGI. It's got a lot of useful features, but here's a couple you may want to take a look at:

  1. $ENV{SCRIPT_NAME}
  2. - Gives you the location, after the root directory, of the script.
  3. $ENV{HTTP_HOST}
  4. - Gives you the original hosting domain.


By using both of these, you could perhaps do something like this:
my $location = $ENV{HTTP_HOST} . $ENV{SCRIPT_NAME};

Which should give you the exact path to get to your script.

Hope I helped,
Spidy