Mark A. Downing wrote:
I'm struggling with a problem that I originally had years ago.

I have a module that establishes connections to Sybase from Apache.
It works fine, but now I'm trying to make it work with Modperl2 and
not having much luck.

The following code works fine with MP1, but not MP2:

sub connect_on_init { push @ChildConnect, [EMAIL PROTECTED] }
if(Apache->can_stack_handlers) {
   Apache->push_handlers(PerlChildInitHandler => sub {
      for my $aref (@ChildConnect) {
         shift @$aref;
         Apache::Sybase::CTlib->connect(@$aref);
      }
   });
}

It doesn't appear to like my check for can_stack_handlers. I've
tried changing it to Apache->can("push_handlers") and it still
doesn't work.

Any tips or advice... I have been unable to find anything in the
archive and in the new docs.

Just remove that if() call. mod_perl 2.0 always supports stacked handlers. I'll update the compat page to reflect this and add a noop for can_stack_handlers (well it'll be always true) in Apache::compat.


Notice that you will still have a problem with an anonymous callback. We still don't support them, so you will need to pass a function name.


__________________________________________________________________ Stas Bekman JAm_pH ------> Just Another mod_perl Hacker http://stason.org/ mod_perl Guide ---> http://perl.apache.org mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com http://modperlbook.org http://apache.org http://ticketmaster.com


-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html



Reply via email to