Hi, Randy, Carl, and Wilson: 

You are right about the current working directory issue. I didn't think of
it, because 
previously, I have another script using a configuration file which in the
same folder as 
the script, and it works well. But that script is in "/cgi-bin/". 

I perform a test. When I put this script to "/cgi-bin/" to let it run as a
stand-alone 
perl process, then cwd is the same as where the script lies. But when I put
this script 
into "/cgi-perl/" to let it run by mod_perl, cwd is where the daemon
"Apache.exe" lies! 
(In my case, it is "d:/apache group/apache") 

Maybe this is due to the fact that mod_perl module is a dynamic linked
library called by 
Apache.exe, just like DLL in Win32, or .so file in Unix. 

No wonder it can't find the file to attach.

Thanks for all these ideas offerred by you guys!
Xu Qiang

Randy Kobes wrote:
> In general, it's not adviseable to assume a particular
> current directory when using mod_perl (or even for cgi
> scripts) - try putting in a call
>    use Cwd;
>    my $cwd = cwd;
>    ...
>    ...
>    print "cwd is <B>$cwd</B>";
> into your script to see what mod_perl has for cwd.
> What you might try, if you don't want to give the full
> path name to the file, is using the environment variable
> DOCUMENT_ROOT, rather than HTTP_HOST.

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to