You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Andrew Wyllie <wy...@dilex.net> on 2005/05/19 15:17:25 UTC

Apache2::Cookie - can't find cookie_clas.al

Hi,

I'm running the latest version of mod_perl and libapreq (from subversion 
- all tests pass).
I getting an error from Apache2::Cookie when I try to create an 
Apache2::Cookie::Jar.


The Error Message:

Can't locate auto/Apache2/Cookie/Jar/cookie_clas.al in @INC (@INC 
contains: /home/wyllie/dev/Alta/blib/lib /home/wyllie/dev/Alta/blib/arch 
/d/fish/web/modules/Alta/t /home/wyllie/dev/Alta/t 
/usr/local/perl-5.8.6/lib/x86_64-linux /usr/local/perl-5.8.6/lib 
/usr/local/perl-5.8.6/lib/site_perl/x86_64-linux 
/usr/local/perl-5.8.6/lib/site_perl .) at
/usr/local/perl-5.8.6/lib/site_perl/x86_64-linux/Apache2/Cookie.pm line 109


The code which causes the error:   

my $jar = Apache2::Cookie::Jar->new( $r, VALUE_CLASS => 
"Alta::Cookies::Cookie" );



I have tried looking through the tests for libapreq, but I could not 
find a reference to Apache2::Cookie::Jar.

I would appreciate any and all suggestions
Thanks!


Andrew

Re: Apache2::Cookie - can't find cookie_clas.al

Posted by Andrew Wyllie <wy...@dilex.net>.

Joe Schaefer wrote:

>Andrew Wyllie <wy...@dilex.net> writes:
>
>  
>
>>my $jar = Apache2::Cookie::Jar->new( $r, VALUE_CLASS =>
>>"Alta::Cookies::Cookie" );
>>    
>>
>
>Oops, looks like I b0rked that API in 2.05.  Here's the preferred
>aproach now:
>
>    my $req = APR::Request::Apache2->handle($r);
>    my $jar = $req->jar;
>    $jar->cookie_class("Alta::Cookies::Cookie");
>    # use $jar as if it were $jar->cookies from 2.04-dev.
>  
>

Thanks Joe - for the fix and the quick response!  That did the trick. 
Now I'm going to spend some time exploring the APR::Request APIs.  It looks
really good to me so far...

Thanks,
Andrew

>  
>
>>I have tried looking through the tests for libapreq, but I could not
>>find a reference to Apache2::Cookie::Jar.
>>    
>>
>
>That package should've died anyways, since we killed off the 
>apreq_jar_t struct in 2.05-dev.  In any case, IMO you're 
>better off learning the APR::Request APIs as they are 
>emerging now.  The core is here:
>
> # like Apache2::Request->new
>  my $req = APR::Request::Apache2->handle($r, ...);
>
>  my $args = $req->args; # the args table
>  my $body = $req->body; # the body table
>  my $param = $req->param; # the param (body + args) table
>  my $upload = $req->upload; # upload table requires APR::Request::Param
>
># each of the tables above are read-only (fast!) tiehash refs, 
># and the values are simple scalars.  But you can upgrade them
># to full params by changing the param_class, ie:
>
>  $body->param_class("APR::Request::Param");
>
># that way you can call methods on each value, $v->is_tainted($on_off),
># $v->charset($number), etc.  Also, by turning off the is_tainted flag,
># that also means you are trusting apreq with the charset 
># interpretation.  That means you can do a single taint-checking 
># sweep across the params in some early section of your code, and have
># later calls to $req->param("foo") marked with its proper utf8 flags.
>
>  
>

Re: Apache2::Cookie - can't find cookie_clas.al

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Andrew Wyllie <wy...@dilex.net> writes:

> my $jar = Apache2::Cookie::Jar->new( $r, VALUE_CLASS =>
> "Alta::Cookies::Cookie" );

Oops, looks like I b0rked that API in 2.05.  Here's the preferred
aproach now:

    my $req = APR::Request::Apache2->handle($r);
    my $jar = $req->jar;
    $jar->cookie_class("Alta::Cookies::Cookie");
    # use $jar as if it were $jar->cookies from 2.04-dev.

> I have tried looking through the tests for libapreq, but I could not
> find a reference to Apache2::Cookie::Jar.

That package should've died anyways, since we killed off the 
apreq_jar_t struct in 2.05-dev.  In any case, IMO you're 
better off learning the APR::Request APIs as they are 
emerging now.  The core is here:

 # like Apache2::Request->new
  my $req = APR::Request::Apache2->handle($r, ...);

  my $args = $req->args; # the args table
  my $body = $req->body; # the body table
  my $param = $req->param; # the param (body + args) table
  my $upload = $req->upload; # upload table requires APR::Request::Param

# each of the tables above are read-only (fast!) tiehash refs, 
# and the values are simple scalars.  But you can upgrade them
# to full params by changing the param_class, ie:

  $body->param_class("APR::Request::Param");

# that way you can call methods on each value, $v->is_tainted($on_off),
# $v->charset($number), etc.  Also, by turning off the is_tainted flag,
# that also means you are trusting apreq with the charset 
# interpretation.  That means you can do a single taint-checking 
# sweep across the params in some early section of your code, and have
# later calls to $req->param("foo") marked with its proper utf8 flags.

-- 
Joe Schaefer