You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by "Garnier, Jeremie" <JG...@nds.com> on 2007/01/30 16:05:42 UTC

undefined routines & mod_dbd

Hi all,

 

I try to make this:

use Apache2::Module ();
# test if an Apache module is loaded
  if (Apache2::Module::loaded('mod_dbd.c')) {
      ...
  }

But it dones:

Undefined subroutine &Apache2::Module::loaded call at...

 

So why does it not work??

It is possible with mod_perl to access to all the other module like mod_dbd?

Thanks,

 

Jérémie

 

***********************************************************************************
Information contained in this email message is confidential and may be privileged, and is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@nds.com and destroy the original message.
*********************************************************************************** 


Re: undefined routines & mod_dbd

Posted by "Philip M. Gollucci" <pg...@p6m7g8.com>.
Robert Landrum wrote:
> I suspect that this may be because you're not actually running in
> mod_perl.  Aside from that, I don't see any methods actually defined in
> Apache2::Module::loaded...  not even a bootstrap.  So it might need to
> be loaded from something like Apache2.
mod_dbd is not yet wrapped in XS/perl glue.
Its something I'd like to make a top goal of 2.0.5 :)

if (MP2) {
    if (Apache2::Module::loaded('Apache2::Status')) {
        Apache2::Status->menu_item(
                                   'DBI' => 'DBI connections',
                                    \&status_function
                                  );
    }
}
else {
   if ($INC{'Apache.pm'}                       # is Apache.pm loaded?
       and Apache->can('module')               # really?
       and Apache->module('Apache::Status')) { # Apache::Status too?
       Apache::Status->menu_item(
                                'DBI' => 'DBI connections',
                                \&status_function
                                );
   }
}

If you want to check if a mod_ is loaded you should probably check out
Apache::Test::need_module('mod_dbd.c')


You can find some good examples of this in
http://svn.apache.org/repos/asf/perl/Apache-SizeLimit/trunk/t/apache2/all.t

Its also perldoc'd in Apache::Test

HTH


------------------------------------------------------------------------
Philip M. Gollucci (pgollucci@p6m7g8.com) 323.219.4708
Consultant - P6M7G8 Consutling - http://p6m7g8.net/Resume/resume.shtml
Senior Software Engineer - Ticketmaster - http://ticketmaster.com
1024D/EC88A0BF 0DE5 C55C 6BF3 B235 2DAB  B89E 1324 9B4F EC88 A0BF

We're halfway there
Livin' on a prayer
Take my hand and we'll make it-I swear
Livin' on a prayer

RE: undefined routines & mod_dbd

Posted by "Garnier, Jeremie" <JG...@nds.com>.
Sorry, i twas just an error in my httpd.conf.
Can I access to mod_dbd function with the mod_perl?
Thanks

Jérémie 

-----Message d'origine-----
De : Robert Landrum [mailto:rlandrum@aol.net] 
Envoyé : mardi 30 janvier 2007 17:46
À : Garnier, Jeremie
Cc : Modperl@perl.apache.org
Objet : Re: undefined routines & mod_dbd

Garnier, Jeremie wrote:
> use Apache2::Module ();
> 
> # test if an Apache module is loaded
> 
>   if (Apache2::Module::loaded('mod_dbd.c')) {
> 
>       ...
> 
>   }
> 
> But it dones:
> 
> Undefined subroutine &Apache2::Module::loaded call at...

I suspect that this may be because you're not actually running in 
mod_perl.  Aside from that, I don't see any methods actually defined in 
Apache2::Module::loaded...  not even a bootstrap.  So it might need to 
be loaded from something like Apache2.

Rob
***********************************************************************************
Information contained in this email message is confidential and may be privileged, and is intended only for use of the individual or entity named above. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@nds.com and destroy the original message.
*********************************************************************************** 


Re: undefined routines & mod_dbd

Posted by Robert Landrum <rl...@aol.net>.
Garnier, Jeremie wrote:
> use Apache2::Module ();
> 
> # test if an Apache module is loaded
> 
>   if (Apache2::Module::loaded('mod_dbd.c')) {
> 
>       …
> 
>   }
> 
> But it dones:
> 
> Undefined subroutine &Apache2::Module::loaded call at…

I suspect that this may be because you're not actually running in 
mod_perl.  Aside from that, I don't see any methods actually defined in 
Apache2::Module::loaded...  not even a bootstrap.  So it might need to 
be loaded from something like Apache2.

Rob