Jabber::Reload - reload modules


Jabber-mod_perl documentation  | view source Contained in the Jabber-mod_perl distribution.

Index


NAME

Top

Jabber::Reload - reload modules

DESCRIPTION

Top

Reload is a helper module to reload modules that have changed during run time.

it is a bit of a copy of Apache::Reload, but not nearly as sophisticated, it just check the time stamp on the file of a module that is registerd, whacks the INC entry for it and then reloads over the top.

EXAMPLES

Top

in the main of your program:

 use Jabber::Reload;

 Jabber::Reload::register(q|Some::Module|);

.... later during the loop

 if ( Jabber::Reload::haveModule(q|Some::Module|) ){
    Jabber::Reload::reload(q|Some::Module|);
 } else {
    Jabber::Reload::loadModule(q|Some::Module|);
 }

also - to ensure that modules loaded and registered by Reload are properly available in the current scope, when using JabberReload::loadModule(), you must put the load in a BEGIN {} block like so:

 use Reload;
 BEGIN { Jabber::Reload::loadModule("TTest"); };

so that you can still address methods like this: TTest::handler;

as opposed to having to do this: TTest->handler;

AUTHOR

Top

Piers Harding - after a lot of plagarism


Jabber-mod_perl documentation  | view source Contained in the Jabber-mod_perl distribution.