You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by su...@fliptroop.com on 2007/01/16 14:59:25 UTC

Apache2::RequestUtil error

Hi folks,

Not sure whether this issue has been resolved earlier, but did my bit 
searching on the list and googled - couldn't find any standard 
solutions working for me. And apologies for the long mail.

I am upgrading our servers to mod_perl 2.0.2 and Apache 2.0.59 
(compiled from source)

We get the following errors for a few of our perl cgi scripts

Usage: Apache2::Cookie->fetch($r): missing argument $r: attempt to 
fetch global Apache2::RequestUtil->request failed: Can't locate object 
method "request" via package "Apache2::RequestUtil" at 
/opt/apache-2.0.59/3plib/lib/perl5/site_perl/5.8.8/i686-linux/Apache2/Coo
kie.pm line 32.
.

I have tried adding
---------------------------
use Apache2;
use Apache2::compat;
---------------------------
in the startup.pl file but Apache can't find Apache2.pm and hence 
wouldn't start. If I just add in the Apache2::compat,  it still shows 
the same above errors.

Any pointers very much appreciated :)

Thanks,
Sunil
________________________________________________________________________
Check out the new AOL.  Most comprehensive set of free safety and 
security tools, free access to millions of high-quality videos from 
across the web, free AOL Mail and more.


Re: Apache2::RequestUtil error

Posted by su...@fliptroop.com.
  On Tue, 16 Jan 2007, sunil@fliptroop.com wrote:

 > Hi folks,
 >
  > Not sure whether this issue has been resolved earlier, but did my 
bit > searching on the list and googled - couldn't find any standard 
solutions > working for me. And apologies for the long mail.
 >
  > I am upgrading our servers to mod_perl 2.0.2 and Apache 2.0.59 
(compiled from > source)
 >
 > We get the following errors for a few of our perl cgi scripts
 >
  > Usage: Apache2::Cookie->fetch($r): missing argument $r: attempt to 
fetch > global Apache2::RequestUtil->request failed: Can't locate 
object method > "request" via package "Apache2::RequestUtil" at > 
/opt/apache-2.0.59/3plib/lib/perl5/site_perl/5.8.8/i686-linux/Apache2/Coo

 > kie.pm line 32.
 > .

 Are you passing $r into fetch()? eg,
 my %cookies = Apache2::Cookie->fetch($r);

 > I have tried adding
 > ---------------------------
 > use Apache2;
 > use Apache2::compat;
 > ---------------------------
  > in the startup.pl file but Apache can't find Apache2.pm and hence 
wouldn't > start. If I just add in the Apache2::compat, it still shows 
the same above > errors.

 Apache2.pm is no longer present in mod_perl; see
 http://perl.apache.org/docs/2.0/rename.html

 -

Thanks Randy,

we are trying to use the older scripts without any modifications. We 
use CGI, and get_session to read up the cookies.  We want to get the 
page working without any issues and hence started using 
Apache2::compat.

--
Regards,
Sunil



________________________________________________________________________
Check out the new AOL.  Most comprehensive set of free safety and 
security tools, free access to millions of high-quality videos from 
across the web, free AOL Mail and more.


Re: Apache2::RequestUtil error

Posted by Phil Whelan <ph...@gmail.com>.
On 17/01/07, Randy Kobes <ra...@theoryx5.uwinnipeg.ca> wrote:
> On Tue, 16 Jan 2007, sunil@fliptroop.com wrote:
>
> > Hi folks,
> >
> > Not sure whether this issue has been resolved earlier, but did my bit
> > searching on the list and googled - couldn't find any standard solutions
> > working for me. And apologies for the long mail.
> >
> > I am upgrading our servers to mod_perl 2.0.2 and Apache 2.0.59 (compiled from
> > source)
> >
> > We get the following errors for a few of our perl cgi scripts
> >
> > Usage: Apache2::Cookie->fetch($r): missing argument $r: attempt to fetch
> > global Apache2::RequestUtil->request failed: Can't locate object method
> > "request" via package "Apache2::RequestUtil" at
> > /opt/apache-2.0.59/3plib/lib/perl5/site_perl/5.8.8/i686-linux/Apache2/Coo
> > kie.pm line 32.
> > .
>
> Are you passing $r into fetch()? eg,
>     my %cookies = Apache2::Cookie->fetch($r);
>

I'd guess this is the issue, since according to the docs Apache1 is

  my $cookies = Apache::Cookie->fetch;

Apache2 is

  my $cookies = Apache2::Cookie->fetch($r);
  my %cookies = Apache2::Cookie->fetch($r);

and the error is thrown only when $r is not defined.

> > I have tried adding
> > ---------------------------
> > use Apache2;
> > use Apache2::compat;
> > ---------------------------
> > in the startup.pl file but Apache can't find Apache2.pm and hence wouldn't
> > start. If I just add in the Apache2::compat,  it still shows the same above
> > errors.
>
> Apache2.pm is no longer present in mod_perl; see
>     http://perl.apache.org/docs/2.0/rename.html
>
> --
> best regards,
> Randy Kobes
>


-- 
Website: http://philw.co.uk
Skype: philwhelan76
Email : phil123@gmail.com
MSN Messenger : philwhelan66@hotmail.com
iChat: philwhln@mac.com

Re: Apache2::RequestUtil error

Posted by Randy Kobes <ra...@theoryx5.uwinnipeg.ca>.
On Tue, 16 Jan 2007, sunil@fliptroop.com wrote:

> Hi folks,
>
> Not sure whether this issue has been resolved earlier, but did my bit 
> searching on the list and googled - couldn't find any standard solutions 
> working for me. And apologies for the long mail.
>
> I am upgrading our servers to mod_perl 2.0.2 and Apache 2.0.59 (compiled from 
> source)
>
> We get the following errors for a few of our perl cgi scripts
>
> Usage: Apache2::Cookie->fetch($r): missing argument $r: attempt to fetch 
> global Apache2::RequestUtil->request failed: Can't locate object method 
> "request" via package "Apache2::RequestUtil" at 
> /opt/apache-2.0.59/3plib/lib/perl5/site_perl/5.8.8/i686-linux/Apache2/Coo
> kie.pm line 32.
> .

Are you passing $r into fetch()? eg,
    my %cookies = Apache2::Cookie->fetch($r);

> I have tried adding
> ---------------------------
> use Apache2;
> use Apache2::compat;
> ---------------------------
> in the startup.pl file but Apache can't find Apache2.pm and hence wouldn't 
> start. If I just add in the Apache2::compat,  it still shows the same above 
> errors.

Apache2.pm is no longer present in mod_perl; see
    http://perl.apache.org/docs/2.0/rename.html

-- 
best regards,
Randy Kobes