Re: Can't call Apache::Request-new()

2001-12-14 Thread Paul Makepeace

On Fri, Dec 14, 2001 at 08:31:26AM +, Ged Haywood wrote:
 Hi there,
 
 On Fri, 14 Dec 2001, Anand R wrote:
 
  The Request Object contains info sent to the server in the client's request.
 [snip]
  Maybe this should not a big problem,U just have to have a look at the
  Apache Doc.
 
 I think he's trying to say
 
 perldoc Apache::Request

Hmm, I was hoping I was way beyond that!

Perhaps I'm not being clear -- I'm use'ing a module and calling a
documented method and then perl is claiming the module isn't loaded. I
showed a command line that demonstrated this ( that the module is
installed) and then said it also happened when under mod_perl. To go
into even more detail, here is how I'm calling it under mod_perl. I'm
new to this so quite possibly the mistake's somewhere here...

httpd.conf:

Files /perl-bin/*.cgi
   SetHandler perl-script
   PerlHandler Apache::Registry
   Options +ExecCGI
   PerlSendHeader On
/Files


apr.cgi:

#!/usr/bin/perl -Tw
use strict;

use Apache::Request;

my $r = shift;
my $apr = Apache::Request-new($r);
my @params = $apr-param;

print HTML;
Content-type: text/plain

@params;
HTML


And sho' nuff ...error.log contains,

Can't locate object method new via package Apache::Request (perhaps you forgot to 
load Apache::Request?) at /home/wwwrp/perl-bin/apr.cgi line 7.
[Fri Dec 14 00:43:14 2001] [error] [client 172.30.0.3] Premature end of script 
headers: /home/wwwrp/perl-bin/apr.cgi

 :)
 
 73,
 Ged.
 
 PS:  Cute email address Paul.

Heh thanks -- no prizes for guessing which device file x10.com@
goes to :-)

55,
Paul

-- 
Paul Makepeace ... http://paulm.com/

What is the meaning of life? The unforgiven.
   -- http://paulm.com/toys/surrealism/



Re: [SOLUTION] Can't call Apache::Request-new()

2001-12-14 Thread Paul Makepeace

On Fri, Dec 14, 2001 at 09:20:06AM -, Matt Sergeant wrote:
 I think I know what's happening here. Your script is running as a CGI, not
 as mod_perl. Check:
 
   print not  unless $ENV{MOD_PERL};
   print running under mod_perl\n;

Yup, this is it. Grrr, seems like my Files /perl-bin/*.cgi was
the problem.

Directory /home/wwwrp/perl-bin
Files *.cgi
SetHandler perl-script
PerlHandler Apache::Registry
Options +ExecCGI
PerlSendHeader On
/Files
/Directory

Thanks Matt  all!

D'oh,
Paul

[1] http://httpd.apache.org/docs/mod/core.html#files

 
 Matt.
 -- 
 :-Get a smart net/:-

-- 
Paul Makepeace ... http://paulm.com/

If the car doesn't start in the rain, then all would be revealed.
   -- http://paulm.com/toys/surrealism/



Re: Can't call Apache::Request-new()

2001-12-13 Thread Paul Makepeace

So no replies to this -- could someone even confirm they have a working
Apache::Request v0.33 on perl 5.6.1? That would be a big help in at
least determining whether it's perhaps something amiss here. Else I'll
file it as a bug.

Cheers,
Paul

On Tue, Dec 11, 2001 at 09:11:50PM -0800, Paul Makepeace wrote:
 I'm getting the following error,
 
 $ perl -MApache::Request -e 'Apache::Request-new'
 Can't locate object method new via package Apache::Request (perhaps you forgot 
to load Apache::Request?) at -e line 1.
 $
 
 ...both from the command line and under a PerlHandler Apache::Registry'd
 script.
 
 Of course, it is installed:
 
 $ perl -MApache::Request -le 'print grep /Request/, values %INC; print 
$Apache::Request::VERSION'
 /usr/local/lib/perl/5.6.1/Apache/Request.pm
 0.33
 $
 
 In all other respects I'm able to discern so far mod_perl, Perl and
 Apache are working here (I have a number of sites using Template Toolkit
 with a custom PerlHandler and a few scripts under Apache::Registry). I'm
 getting this error from both a fresh CPAN install and Debian's
 libapache-request-perl package (not installed at the same time!).
 
 Any suggestions where to start looking?
 
 Thanks,
 Paul
 
 PS Rather than cluttering your inbox, perl -V is at
http://paulm.com/tmp/perl_v.txt



Can't call Apache::Request-new()

2001-12-11 Thread Paul Makepeace

I'm getting the following error,

$ perl -MApache::Request -e 'Apache::Request-new'
Can't locate object method new via package Apache::Request (perhaps you forgot to 
load Apache::Request?) at -e line 1.
$

...both from the command line and under a PerlHandler Apache::Registry'd
script.

Of course, it is installed:

$ perl -MApache::Request -le 'print grep /Request/, values %INC; print 
$Apache::Request::VERSION'
/usr/local/lib/perl/5.6.1/Apache/Request.pm
0.33
$

In all other respects I'm able to discern so far mod_perl, Perl and
Apache are working here (I have a number of sites using Template Toolkit
with a custom PerlHandler and a few scripts under Apache::Registry). I'm
getting this error from both a fresh CPAN install and Debian's
libapache-request-perl package (not installed at the same time!).

Any suggestions where to start looking?

Thanks,
Paul

PS Rather than cluttering your inbox, perl -V is at
   http://paulm.com/tmp/perl_v.txt

-- 
Paul Makepeace ... http://paulm.com/

If laughter can heal, then a priest will behave very oddly.
   -- http://paulm.com/toys/surrealism/