I've found it safest to get the current directory from the PROGRAM_NAME
variable as:

($CGIPath) = ($0 =~ m#^(.*\\)#);
require $CGIPath . 'newlib.pl';

So far this has kept me out of trouble in multiple win32 installations, both
ISAPI and CGI. I wish MS and/or Active State would quit changing the rules.

Jim Rickenbacker

> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]On Behalf Of
> Roland Corbet
> Sent: Thursday, March 22, 2001 6:29 AM
> To: [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: Current Path for CGI perl on Win NT
>
>
> We run Activeperl build 613 on our NT 4 servers with Option Pack 4 and
> Service Pack 6 installed.
>
> Originally, we started to use ISAPI Perl (.plx) which is great for
> developing on the web.  All paths can be referred to relatively
> (../ etc.)
> however, no matter how carefully we program our scripts, they always seem
> to cause memory leaks on the box.  We have tried everything to move away
> from causing the memory to leak into inetinfo.exe, for example,
> the use of
> "use strict", "my" , "our", and using DBI::ODBC instead of Win32::ODBC.
>
> As a result, I have decided that we should move to using standard, CGI
> Perl.  This will now prevent causing a memory leak into inetinfo.exe as
> each script runs in its own process space, and not within the
> inetinfo.exe
> process.
>
> One problem with CGI Perl on NT is that I can't seem to use
> relative paths,
> as I could in ISAPI Perl.  I understand that this is probably due
> to ISAPI
> Perl being more integrated into the web server environment than CGI Perl.
>
> I can get hold of the current working path by using the
> environment variable:
>
> $SCRIPTS = $ENV{'PATH_INFO'};
>
> The main reason for this is so that I can use include files in the same
> directory as the script that is executing, eg:
>
> require "myfile.pl";
>
> would work under ISAPI, but not under CGI.
>
> With CGI, it appears that the default path is set to where Perl is
> installed, which is not of much use for trying to find a script that's in
> the same directory as the current, executing script.
>
> Does anyone know if, or how I can make use of relative paths in CGI Perl.
> (When developing with Perl on Unix systems, I have this ability).
>  Perhaps
> with a set path command?  Do I need to modify the script mapping - .pl ->
> c:\perl\bin\perl.exe %s %s ?
>
> Alternatively, can anyone tell me if a newer version of ISAPI Perl is
> available after 613 (620 maybe?) that don't cause memory leaks into
> inetinfo.exe, or how to avoid them altogether.
>
> Any help would be greatly appreciated.
>
> TIA
>
> Roland
>
> _______________________________________________
> Perl-Win32-Web mailing list
> [EMAIL PROTECTED]
> http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
>

_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

Reply via email to