Click to See Complete Forum and Search --> : $ENV{DOCUMENT_ROOT} but for Windows?


JDWilliams
06-09-2006, 10:32 AM
I keep meaning to move everything over to a Linux server but haven't had the time yet. What I'm currently using is ActivePerl 5.8.7 on a Windows 2003 server with IIS 6.0. The issue I'm having is that I'm using HTML::Template and am wanting to point to where the template file is.

The following won't work because I'm on Windows:

use constant TMPL_FILE => $ENV{DOCUMENT_ROOT}/templates/billchg1-2.tmpl

My question is how do I point to the document root on Windows without having to hardcode the above?

chrisranjana
06-12-2006, 12:44 PM
Is the perl command cwd (http://perl.active-venture.com/lib/Cwd.html) any help at all ?

JDWilliams
06-13-2006, 08:08 AM
I'll give that a try. That looks like the perfect solution. Thanks!

Jeff Mott
06-13-2006, 11:15 PM
You can, and probably should, use the FindBin (http://perldoc.perl.org/FindBin.html) module for identifying these directories on any OS.