You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Boysenberry Payne <bo...@humaniteque.com> on 2005/09/14 20:15:13 UTC

Getting param

Yea, I got Apache2/MP2 installed and running on my OS X box.

Now I'm rewriting my code and am getting the error:

Can't locate object method "param" via package "Apache2::RequestRec"

Here is what I have:

sub handle {
	my $r = shift;
	my $c = $r->connection;
	my $apr = Apache2::RequestRec->new( $r );
	my $data;
	foreach my $name ( $apr->param ) {
		my $i = 0;
		foreach( $apr->param( $name ) ) {
			$i++;
		}
		if( $i == 1 ) {
			$data->{$name} = $apr->param( $name );
		} elsif( $i > 1 ) {
			my @type = $apr->param( $name );
			$data->{$name} = \@type;
		}
	}
}

It used to have:

	use Apache::Request;
	my $r = shift;
	my $apr = Apache::Request->new( $r );
	my $data;
	foreach my $name ( $apr->param ) {
		my $i = 0;
		foreach( $apr->param( $name ) ) {
			$i++;
		}
		if( $i == 1 ) {
			$data->{$name} = $apr->param( $name );
		} elsif( $i > 1 ) {
			my @type = $apr->param( $name );
			$data->{$name} = \@type;
		}
	}

What is the equivalent for MP2?
I tried:
perl -MModPerl::MethodLookup -e print_method param

And got no love.

PS Thanks for the help with getting the installs set up correctly.  
Compared to the first time
I tried to install Apache2/MP2 it was a breeze.

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

Re: Getting param

Posted by Boysenberry Payne <bo...@humaniteque.com>.
The install for expat 1.95.8 and APR::Request went great.

But now in my error_log I get the following:
dyld: /usr/local/httpd/bin/httpd version mismatch for library:  
/usr/local/httpd/lib/libexpat.0.dylib (compatibility version of user:  
6.0.0 greater than library's version: 2.0.0)

It seems Apache doesn't like it maybe?


Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Sep 14, 2005, at 2:44 PM, Boysenberry Payne wrote:

> While trying to install APR::Request::Apache2 I got the following  
> error(s):
>
> gcc -g -O2 -o .libs/test_cgi test_cgi.o   
> /Users/boysie/.cpan/build/libapreq2-2.06-dev/library/.libs/ 
> libapreq2.dylib -lexpat  
> -L/Users/boysie/src/httpd-2.0.54/srclib/apr-util/xml/expat/lib  
> /Users/boysie/src/httpd-2.0.54/srclib/apr-util/xml/expat/lib/.libs/ 
> libexpat.dylib /usr/local/httpd/lib/libaprutil-0.dylib  
> /usr/local/httpd/lib/libexpat.dylib /usr/lib/libiconv.dylib  
> /usr/local/httpd/lib/libapr-0.dylib -lresolv -lpthread
> ld: can't locate file for: -lexpat
> make[2]: *** [test_cgi] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all-recursive] Error 1
>
> Any ideas on how to get it installed?
>
> I did the following before make:
> perl Makefile.PL --with-apache2-apxs=/usr/local/httpd/bin/apxs
>
> I'm trying to build on OS X 10.3.9
>
> Thanks,
> Boysenberry
>
> boysenberrys.com | habitatlife.com | selfgnosis.com
>
> On Sep 14, 2005, at 2:30 PM, Joe Schaefer wrote:
>
>> Boysenberry Payne <bo...@humaniteque.com> writes:
>>
>>> What is the difference between:
>>>
>>> APR::Request::Apache2
>>> and
>>> Apache2::RequestRec
>>
>> Apache2::RequestRec is the perl module representing httpd's  
>> request_rec
>> struct.  APR::Request::Apache2 is the perl module for interfacing with
>> mod_apreq2, which is part of libapreq2.  Basically  
>> APR::Request::Apache2
>> is a plugin for Apache2::RequestRec, that is responsible for parsing  
>> form
>> data.
>>
>> -- 
>> Joe Schaefer
>>
>>
>>
>
>
>


Re: Getting param

Posted by Boysenberry Payne <b0...@comcast.net>.
While trying to install APR::Request::Apache2 I got the following  
error(s):

gcc -g -O2 -o .libs/test_cgi test_cgi.o   
/Users/boysie/.cpan/build/libapreq2-2.06-dev/library/.libs/ 
libapreq2.dylib -lexpat  
-L/Users/boysie/src/httpd-2.0.54/srclib/apr-util/xml/expat/lib  
/Users/boysie/src/httpd-2.0.54/srclib/apr-util/xml/expat/lib/.libs/ 
libexpat.dylib /usr/local/httpd/lib/libaprutil-0.dylib  
/usr/local/httpd/lib/libexpat.dylib /usr/lib/libiconv.dylib  
/usr/local/httpd/lib/libapr-0.dylib -lresolv -lpthread
ld: can't locate file for: -lexpat
make[2]: *** [test_cgi] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Any ideas on how to get it installed?

I did the following before make:
perl Makefile.PL --with-apache2-apxs=/usr/local/httpd/bin/apxs

I'm trying to build on OS X 10.3.9

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Sep 14, 2005, at 2:30 PM, Joe Schaefer wrote:

> Boysenberry Payne <bo...@humaniteque.com> writes:
>
>> What is the difference between:
>>
>> APR::Request::Apache2
>> and
>> Apache2::RequestRec
>
> Apache2::RequestRec is the perl module representing httpd's request_rec
> struct.  APR::Request::Apache2 is the perl module for interfacing with
> mod_apreq2, which is part of libapreq2.  Basically  
> APR::Request::Apache2
> is a plugin for Apache2::RequestRec, that is responsible for parsing  
> form
> data.
>
> -- 
> Joe Schaefer
>
>
>


Re: Getting param

Posted by Tom Schindl <to...@gmx.at>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Joe Schaefer wrote:
> Boysenberry Payne <bo...@humaniteque.com> writes:
> 
> 
>>What is the difference between:
>>
>>APR::Request::Apache2
>>and
>>Apache2::RequestRec
> 
> 
> Apache2::RequestRec is the perl module representing httpd's request_rec
> struct.  APR::Request::Apache2 is the perl module for interfacing with
> mod_apreq2, which is part of libapreq2.  Basically APR::Request::Apache2
> is a plugin for Apache2::RequestRec, that is responsible for parsing form
> data.
> 
As a side note: I love that Apache2::Request is renamed because it
aovids the confusion many people have about

mp1:
Apache - Apache::Request

mp2:
Apache2::RequestRec - Apache2::Request


Tom
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
Comment: Using GnuPG with Mandriva - http://enigmail.mozdev.org

iD8DBQFDKSOLkVPeOFLgZFIRAjRdAKCyAr0LF87zSVXLMnwRJhXIhGjMBgCfQqSB
9md1TAqCLxNiayfMP+QKWWk=
=Yj5l
-----END PGP SIGNATURE-----

Re: Getting param

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Boysenberry Payne <bo...@humaniteque.com> writes:

> What is the difference between:
>
> APR::Request::Apache2
> and
> Apache2::RequestRec

Apache2::RequestRec is the perl module representing httpd's request_rec
struct.  APR::Request::Apache2 is the perl module for interfacing with
mod_apreq2, which is part of libapreq2.  Basically APR::Request::Apache2
is a plugin for Apache2::RequestRec, that is responsible for parsing form
data.

-- 
Joe Schaefer


Re: Getting param

Posted by Boysenberry Payne <bo...@humaniteque.com>.
What is the difference between:

APR::Request::Apache2
and
Apache2::RequestRec

Thanks,
Boysenberry

boysenberrys.com | habitatlife.com | selfgnosis.com

On Sep 14, 2005, at 1:41 PM, Philip M. Gollucci wrote:

> Philip M. Gollucci wrote:
>> You want instead
>> use APR::Reuest::Apache2 ();
>> my $apr = APR::Reuest::Apache2->handle($r);
>> my $FORM = $req->param; ## hashref implemented as a tied hash to an 
>> APR::Table
>> my $param1_value = $FORM{param1}
> Note
> s/Reuest/Request/g
>
> Sorry!
>
> -- 
> END
> ------------------------------------------------------------
>     What doesn't kill us can only make us stronger.
>                 Nothing is impossible.
> 				
> Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
> Consultant / http://p6m7g8.net/Resume/
> Senior Developer / Liquidity Services, Inc.
>   http://www.liquidityservicesinc.com
>        http://www.liquidation.com
>        http://www.uksurplus.com
>        http://www.govliquidation.com
>        http://www.gowholesale.com
>
>
>

Re: Getting param

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Philip M. Gollucci wrote:
> You want instead
> 
> use APR::Reuest::Apache2 ();
> 
> my $apr = APR::Reuest::Apache2->handle($r);
> my $FORM = $req->param; ## hashref implemented as a tied hash to an 
> APR::Table
> 
> my $param1_value = $FORM{param1}
Note
s/Reuest/Request/g

Sorry!

-- 
END
------------------------------------------------------------
     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
				
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
        http://www.liquidation.com
        http://www.uksurplus.com
        http://www.govliquidation.com
        http://www.gowholesale.com


Re: Getting param

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Boysenberry Payne wrote:
> Yea, I got Apache2/MP2 installed and running on my OS X box.
YAY!

> 
> Now I'm rewriting my code and am getting the error:
Excellent

> 
> Can't locate object method "param" via package "Apache2::RequestRec"
Thats because its not there :)
You need libapreq
http://httpd.apache.org/apreq

> my $apr = Apache2::RequestRec->new( $r );
You want instead

use APR::Reuest::Apache2 ();

my $apr = APR::Reuest::Apache2->handle($r);
my $FORM = $req->param; ## hashref implemented as a tied hash to an APR::Table

my $param1_value = $FORM{param1}
.....

> What is the equivalent for MP2?
> I tried:
> perl -MModPerl::MethodLookup -e print_method param
Its not in mp2 ... I've been thinking wondering if libapreq2 should have an equivalent
for MethodLookup.pm



-- 
END
------------------------------------------------------------
     What doesn't kill us can only make us stronger.
                 Nothing is impossible.
				
Philip M. Gollucci (pgollucci@p6m7g8.com) 301.254.5198
Consultant / http://p6m7g8.net/Resume/
Senior Developer / Liquidity Services, Inc.
   http://www.liquidityservicesinc.com
        http://www.liquidation.com
        http://www.uksurplus.com
        http://www.govliquidation.com
        http://www.gowholesale.com