You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Goehring, Chuck Mr., RCI - San Diego" <cg...@resourceconsultants.com> on 2003/04/08 19:29:39 UTC

RE: [mp2] File I/O Riddle solved

Stas,

Found the problem.  It creates and writes to the file in E:\Apache2 instead of the directory the script executes from under 1.x.  When I put an absolute path in, I got the results I expected.  

Did not have config as you suspected.  http.conf is:

ScriptAlias /cgi-perl/ "E:/Apache2/cgi-perl/"

  Alias /perl/ "e:/Apache2/cgi-perl/"

  <Location /perl>
     SetHandler perl-script
     PerlResponseHandler ModPerl::Registry
     Options +ExecCGI
     PerlOptions +ParseHeaders
  </Location>


All fixed up.

Thanks
Chuck


-----Original Message-----
From: Stas Bekman [mailto:stas@stason.org]
Sent: Monday, April 07, 2003 10:37 PM
To: Goehring, Chuck Mr., RCI - San Diego
Cc: Modperl@Perl.Apache.Org (E-mail)
Subject: Re: [mp2] File I/O


Goehring, Chuck Mr., RCI - San Diego wrote:
> mp2 Guys,
> 
> The test program below works fine under mp1.  Under mp2, no error is thrown but nothing is written to the file.  I built mod_perl-1.99_08.

You must be using 'SetHandler modperl' instead of 'SetHandler perl-script', 
the former requires you to use $r->print instead of print. See:
http://perl.apache.org/docs/2.0/user/config/config.html#C_SetHandler_

> # Just some output to the web page.
> print "<BR>PATH: " . $ENV{"PATH"};

I'm not sure if it's going to be easy to try to detect this and complain when. 
I suppose we could override print and check that the selected stream is a tied 
STDOUT, but I'm afraid it'll create too much of an overhead to do that on 
every call.

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Re: [mp2] File I/O Riddle solved

Posted by Stas Bekman <st...@stason.org>.
Goehring, Chuck Mr., RCI - San Diego wrote:
> Stas,
> 
> Found the problem.  It creates and writes to the file in E:\Apache2 instead of the directory the script executes from under 1.x.  When I put an absolute path in, I got the results I expected.  
> 
> Did not have config as you suspected.  http.conf is:
> 
> ScriptAlias /cgi-perl/ "E:/Apache2/cgi-perl/"
> 
>   Alias /perl/ "e:/Apache2/cgi-perl/"
> 
>   <Location /perl>
>      SetHandler perl-script
>      PerlResponseHandler ModPerl::Registry
>      Options +ExecCGI
>      PerlOptions +ParseHeaders
>   </Location>

Sorry, I didn't understand what was the original config that caused a problem?

> Goehring, Chuck Mr., RCI - San Diego wrote:

>>The test program below works fine under mp1.  Under mp2, no error is thrown but nothing is written to the file.  I built mod_perl-1.99_08.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com