Thanks for the quick reply. use Apachd2::RequestIO solve the problem (I am trying to migrate from MP1 to MP2 and I thought Apache2::Request would already did that.)

Harry

----- Original Message ----- From: "Frank Wiles" <[EMAIL PROTECTED]>
To: "Harry Zhu" <[EMAIL PROTECTED]>
Cc: <modperl@perl.apache.org>
Sent: Wednesday, December 21, 2005 10:15 AM
Subject: Re: $r->print doesn't work in Apache2/MP2/Libapreq2?


On Wed, 21 Dec 2005 10:06:29 -0600
"Harry Zhu" <[EMAIL PROTECTED]> wrote:


sub handler {
  my $r = Apache2::Request->new(shift);
  my %ins = &processInput($r);
  ...
  $r->print($html);
  return OK;
}

Can't locate auto/Apache2/Request/print.al in @INC (@INC contains:
/www/modperl /usr/local/lib/perl5/5.8.7/i686-linux
/usr/local/lib/perl5/5.8.7 /usr/local/lib/perl5/site_perl/5.8.7/i686-linux
/usr/local/lib/perl5/site_perl/5.8.7 /usr/local/lib/perl5/site_perl .
/usr/local/apache2) at /www/modperl/Sys/Handler.pm line 81

if change "$r->print" to "print", it works fine. A quick browsing
through the MP2 documents for the example handler, some using print
while others using $r->print (without Apache2::Request), does
$r->print under Apache2::Request?


 You probably don't want to do that.  Apache2::Request is a wrapper
 for libapreq for parsing query parameters.

 You want to do this instead:

 sub handler {
     my $r = shift;
     my $req = Apache2::Request->new( $r );
     my %ins = &process_input($req);

     $r->print.....
 }

 You'll also need to use or preload Apachd2::RequestIO as this provides
 the print function.

 Hope this helps.

---------------------------------
  Frank Wiles <[EMAIL PROTECTED]>
  http://www.wiles.org
---------------------------------




--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.3/209 - Release Date: 12/21/2005



Reply via email to