Hi fellow monks,
I've got a site which I'm trying to use on two different platforms: Win2000/IIS and Linux/Apache.
Everything succeeds, except for one thing:
require "../config.pl";
What doesn't work is that the IIS can't find the config.pl-file, even though it's got '.' in it's @INC.
The simplest solution would off course be to use an absolute path, but the thing is that I want the config-file to tell me what the abs. path is, not define it in multiple files.
So it looks like IIS-perl (activeperl v5.8) doesn't like the '../'.
Okay, so the solution:
$temp = $ENV{'PATH_TRANSLATED'}; # get full path
$temp =~ s|\\|/|g; # convert \ to / (necessary if win)
$temp =~ s/\/([^\/]*)\/([^\/]*)$//; # strip the last two parts (filena
+me and current folder) to get to '../'
push(@INC, $temp); # now it's got the right folder
require "config.pl"; # so the '../' isn't needed
But I'm 100% sure there are many better things to do instead of this.
Would someone be so kind to help me with this issue?
Thanx in advance, Paul