NAME
Zoidberg - a modular perl shell
SYNOPSIS
FIXME
DESCRIPTION
This is devel documentation, if you're looking for user documentation start with man page zoid(1)
This class provides an event and plugin engine.
FIXME more verbose description
METHODS
Some methods:
new()
-
Simple constructor
init(%attr)
-
Initialize secondary objects and sets config.
%attr
is merged with%{$self}
and is ment for runtime variables. System config should not be set here, but in Zoidberg::Config. main_loop()
-
Spans interactive shell reading from secondary object 'Buffer' or from STDIN. To quit this loop the routine
exit()
of this package should be called. list_objects()
-
List secondary objects. These do not need to be loaded allready, the list is based on the config files.
object($zoidname)
-
Returns secondary object stored under $zoidname. The first time this will "autoload" the object's packages and initialise it.
test_object($zoidname, $class)
-
Returns true if object $zoidname exists and is blessed as $class. Since this calls
object($zoidname)
the object will be initialised when tested. print($ding, $type, $options)
-
DEPRECATED - in time this will be moved to a package Zoidberg::Output
Use this in secondary objects and plugins.
Fancy print function -- used by plugins to print instead of perl function "print". It uses Data::Dumper for complex data
$ding
can be ref or string of any kind$type
can be any string and is optional. Common types: "debug", "message", "warning" and "error".$type
also can be an ansi color.$options
is an string containing chars as option switches.n : put no newline after string m : force markup s : data is ref to array of arrays of scalars -- think sql records
ask($question)
-
DEPRECATED - in time this will be moved to a package Zoidberg::Output
Prompts
$question
to user and returns answer reload($class)
-
Re-read the source file for class
$class
. This can be used to upgrade packages on runtime. This might cause real nasty bugs when versions are incompatible. rehash_plugins()
-
Re-read config files for plugins and cache the contents. This is needed after adding a new plugin config file. When changing plugins it might not always be a "seamless upgrade".
init_object($zoidname)
-
Initialise a secundary object or plugin by the name of
$zoidname
. This is used to autoload plugins. The plugin's meta data is taken from the (cached) configuration file in the plugins dir by the same name (and the extension ".pd"). exit()
-
Called by plugins exit zoidberg -- this ends a interactive
main_loop()
loop round_up()
-
This method should be called before letting the object being destroyed, it allows secundairy objects to be cleaned up nicely. If this is forgotten,
DESTROY
will try to do this for you but an error will be printed to STDERR. From here all secundairy objects having around_up()
method will be called recursively.
AUTHOR
Jaap Karssenberg || Pardus [Larus] <j.g.karssenberg@student.utwente.nl>
R.L. Zwart, <carl0s@users.sourceforge.net>
Copyright (c) 2002 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/language/misc/Artistic.html