Bot::Cobalt::Core::Loader - Object loader/unloader
use Try::Tiny; require Bot::Cobalt::Core::Loader; ## Attempt to import a module: my $plugin_obj = try { Bot::Cobalt::Core::Loader->load($module_name, @args) } catch { # . . . load failed, maybe die with an error . . . }; ## Check reloadable status of a plugin object: if ( Bot::Cobalt::Core::Loader->is_reloadable($plugin_obj) ) { . . . } ## Clean up a module after dropping a plugin object: Bot::Cobalt::Core::Loader->unload($module_name);
A small load/unload class for managing Bot::Cobalt plugins.
Given a module name in the form of 'My::Module', tries to load and instantiate the specified module view new().
new()
Optional arguments can be specified to be passed to new():
$obj = Bot::Cobalt::Core::Loader->load($module_name, @args)
Throws an exception on error.
Given a module name in the form of 'My::Module', tries to delete the module from %INC and clear relevant symbol table entries.
Always returns boolean true.
Given a blessed object, checks to see if the plugin declares itself as NON_RELOADABLE. Returns boolean true if the object appears to be declared reloadable.
Jon Portnoy <avenj@cobaltirc.org>
To install Bot::Cobalt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bot::Cobalt
CPAN shell
perl -MCPAN -e shell install Bot::Cobalt
For more information on module installation, please visit the detailed CPAN module installation guide.