in reply to Calls to Apache::Request's param method sometimes end the program and return no data

There's nothing wrong with the code you posted here, but it is possible that you have an accidental closure somewhere that causes you to keep an old $apr around and try to use it after the XS side has gone away. The best way to troubleshoot is usually to use the -X flag to httpd, so that you get a single process. This will let you reproduce the problem reliably.

You may get better help on the mod_perl list. You should provide your OS and versions of apache, mod_perl, perl, and libapreq. There is a reporting script on the mod_perl site that can grab this for you.

If you are desperate to fix this quickly, I suggest just dropping Apache::Request and using something pure perl and fast, like CGI_Lite or CGI::Simple.

  • Comment on Re: Calls to Apache::Request's param method sometimes end the program and return no data

Replies are listed 'Best First'.
Re^2: Calls to Apache::Request's param method sometimes end the program and return no data
by cfreak (Chaplain) on Dec 02, 2004 at 19:42 UTC

    Thanks for your reply. I will try the -X flag.

    Can you give me an example some code that would cause a closure that you describe?

    I'd love to just switch to a different module. Unfortunatly I use a lot of Apache's methods through Apache::Request since Apache::Request is a sub-class. I'd have to go through my entire program change all that so it probably wouldn't save me a lot of time :(

      This is an example of a closure:

      my $apr; sub handler { my $r = shift; $apr = Apache::Request->new($r); other_sub(); } sub other_sub { my $foo = $apr->some_method(); }
      Basically, anything where a sub refers to a lexical defined outside of the sub.