Perl cgi path question

Sailor

Perch
I've got a new customer I'll be moving over to a windows server soon. However, in the meantime his current host just broke his existing cgi by requiring him to move it to /cgi-bin It's an ancient script and the original programmer hard-coded it to run from the web root. I'm trying to just fix this until I can get him moved to my server.

Here's the issue: the script uses Perl's "opendir()" command to read files in a given directory. It expects that directory to be under the current directory. But now the script is running from /cgi-bin so it is failing. How can I tell Perl to look in the user's html directory. Here's the appropriate line:
my $portfolioDir = cwd() . "/images/photos";

and here's the line that fails:
opendir(DIR, $portfolioDir) or die "can't open the dir: $!";

I tried ".." after the cwd() but that just returns the path as "1E0" for some reason.

Any Perl hackers got a suggestion for how to fix this?

Thanks
 
Back
Top