perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Duran" <>
Subject [MP2] having trouble obtaining $r
Date Thu, 11 Aug 2005 01:54:59 GMT

  Sorry, my last email was sent out without a subject.

  I'm having trouble getting the request object from mod_perl.  Here is the original attempt:

#use Apache2::RequestUtil;
use Apache2::compat;
use Apache;

my $r = Apache->request();

  This generates the following error:

Bareword "Apache2::ServerUtil::server_root" not allowed while "strict subs" in use at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/Apache2/
line 346.
BEGIN not safe after errors--compilation aborted at /usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/Apache2/
line 429.


  This is the second attempt:

use Apache2::RequestUtil;
#use Apache2::compat;
#use Apache;

my $r = Apache2::RequestUtil->request;

  This produces the following error:

Can't locate object method "request" via package "Apache2::RequestUtil" 


  This is the corresponding section of the httpd.conf file.  Uncommenting the SetHandler directive
causes the browser to display the code of the perl script.

LoadModule perl_module modules/

PerlModule Apache2::compat

AddHandler cgi-script .cgi
AddHandler perl-script .pl

Alias /auth/ "/web/ssldocs/foobar/auth/"

<Directory /web/ssldocs/foobar/auth> 
  AllowOverride None
  Options +ExecCGI
  #SetHandler perl-script
  PerlOptions +GlobalRequest 

  Please advise.


View raw message