Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Apache conflicts with my modules

by echo (Pilgrim)
on Aug 29, 2001 at 12:56 UTC ( [id://108713]=note: print w/replies, xml ) Need Help??


in reply to Apache conflicts with my modules

Since the module you're referring to isn't a mod_perl handler, I assume you have a script that uses this module, and the error is occuring in that script. An error in Apache::Request suggest that this script is running under Apache::Registry. Hard to tell what's wrong without seeing some code, but a shot in the dark: your script is shifting what it believes are command line arguments, under mod_perl this will retrieve a reference to the request object, maybe not what you expect.

Replies are listed 'Best First'.
Re: Re: Apache conflicts with my modules
by IOrdy (Friar) on Aug 29, 2001 at 17:24 UTC
    you can check the code for my module under this node. Apart from some small changes (dumb stuff like returning my $class instead of $self) it's pretty much the same.

    The script I'm calling it from is stripped back to:
    #!/usr/bin/perl -w use lib '/home/iordy/perl.iordy.net'; use strict; use iXML::TheConstruct; use Apache::Request; my $r = Apache->request; my $apr = Apache::Request->new($r); my $construct = iXML::TheConstruct->new();

    regardless of where I have 'my $r = Apache->request;' it tells me It cannot find the method "new()" under module Apache::Request;.

    now I have written stuff (1 or 2 things only; I'm new to perl) in this manner before but I have never done it with a module I have written myself (the module shown in the node listed above is my first ever attempt.)

    so I'm stumped as to why this would be happening.
      Is libapreq installed? That's where the Apache::Request object comes from. If you don't need its extended features, you can just use $r which is usually enough.

      BTW, you can write:

      my $r = shift;
      instead of
      my $r = Apache->request;
        I was told I should be using Apache::Request for things like:
        my $r = Apache->request; my $apr = Apache::Request->instance($r, DISABLE_UPLOADS => 1); my $args = $apache_request->param;
        Someone (I think it was on here) said it was better/safer than using just $r as I could set stuff like DISABLE_UPLOADS and the max size for post/get requests.

        What is it with shift? To tell you the truth I dont understand how it can be use in such an instance. I know that it returns & removes the first argument in an array ie. @ARGV , @_ or @whatever. I know that Apache wraps your script so that having it in my script (not a sub) should return the class name i.e Apache but why can it replace Apache->request which I thought would be a subroutine?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://108713]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (4)
As of 2024-03-29 07:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found