CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
Solution to IIS relative paths, compatible though



Oct 15, 2001, 12:05 AM

Post #1 of 1 (587 views)
Solution to IIS relative paths, compatible though Can't Post

OK, I've posted this code is some otehr topics aswell. I think it's very important everone knows about this.

Most comlex scripts fail running under IIS with relative paths or require 'file' files. Most of the time, a 'can't locate at @INC', or 'file not found' message appears (or is written in the error log). This is because the current directory in IIS is the WWW-root. I've seen a solution to this problem in the code of a different BB system.

Here it is:

$THIS_PATH = 'current-directory-you-specified';
push @INC, $THIS_PATH;


# This all works now!!!
require '';
open('file.txt') or die ....

Hope it helps... (well, it worked for me)

P.S. Currently, I'm developing a bunch of mudules for this.
XProgramming::CGI::Location; // auto detects location of CGI + IIS bugfix
XProgramming::CGI::ErrorTrap; // handle errors better, with personal dialogs
XProgramming::CGI::Template; // template parser
And so on.
They are not available as single download at this moment, but they have been includes in the source code of my own forum, available from


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives