Zoidberg::Fish - Base class for loadable Zoidberg plugins
package My_Zoid_Plugin; use base 'Zoidberg::Fish'; FIXME some example code
Once this base class is used your module smells like fish -- Zoidberg WILL eat it. It supplies stub methods for hooks and has some routines to simplefy the interface to Zoidberg. One should realize that the bases of a plugin is not the module but the config file. Any module can be used as plugin as long as it's properly configged. The developer manual should describe this in more detail.
new($parent, $zoidname)
Simple constructor that bootstraps same attributes. When your module smells like fish Zoidberg will give it's constructor two arguments, a reference to itself and the name by which your module is identified. From this all other config can be deducted.
# Default attributes created by this constructor: $self->{parent} # a reference to parent Zoidberg object $self->{zoidname} # name by which your module is identified $self->{settings} # reference to hash with global settings $self->{config} # hash with plugin specific config
init()
To be overloaded, will be called directly after the constructor. Do things you normally do in the constructor like loading files, opening sockets or setting defaults here.
parent()
config()
These methods return a reference to the attributes by the same name.
call($event, @args)
Call a hook (implemented as an event). Use this to glue plugins.
broadcast($event_name, @_)
Broadcast an event to whoever might be listening.
register_event($event_name, $method)
Register for an event by the parent object. When the event occurs, the method $method will be called. $method is optional and defaults to the event name. $method can also be a CODE reference.
$method
unregister_event($event_name)
Unregister self for event $event_name.
$event_name
TODO
ask($question, $default)
Get interactive input. The default is optional. If the default is either 'Y' or 'N' a boolean value is returned.
round_up()
Is called when the plugin is unloaded or when a sudden DESTROY occurs. To be overloaded, do things like saving files or closing sockets here.
add_context(%config)
FIXME / see man zoiddevel
R.L. Zwart, <rlzwart@cpan.org>
Jaap Karssenberg || Pardus [Larus] <pardus@cpan.org>
Copyright (c) 2002 Raoul L. Zwart. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Zoidberg, Zoidberg::Utils, http://zoidberg.sourceforge.net
To install Zoidberg, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Zoidberg
CPAN shell
perl -MCPAN -e shell install Zoidberg
For more information on module installation, please visit the detailed CPAN module installation guide.