Zoidberg - a modular perl shell
You most likely want to use the default config files as installed by the ProgramFiles package and all the modules from the Zoidberg package.
use Zoidberg; # set config my $fluff_conf = { 'prefix' => '/usr/local', # $prefix/share/zoid/... expected to exist 'config_dir' => '/home/my_user/.zoid', 'config_file' => 'profile.pd', 'core_file' => 'core.pd', 'grammar_file' => 'grammar.pd', }; # create and init parent object my $cube = Zoidberg->new; $cube->init($fluff_conf); # start interactive mode $cube->main_loop; # exit nicely my $exit = $cube->round_up ? 1 : 0; exit $exit;
Zoidberg provides a shell written in perl, configured in perl and operated in perl. It is intended to be a replacement for bash in the future, but that is a long way. Most likely you will have to be a perl programmer or developer to enjoy this.
This class provides a parent object in charche of a whole bunch of plugins. Most of the real functionality is put in this plugins. Also this class is in charche of broadcasting events. Stubs are provided for core plugins. This class autoloads plugin names as subroutines.
None by default.
Some usefull methods:
Simple constructor
Initialize secondary objects and set config
Spans interactive shell reading from secondary object 'Buffer' or from STDIN.
List secondary objects.
Returns secondary object stored under $zoidname.
Returns true if object $zoidname exists and is blessed as $class
List aliases in grammar -- used to generate help function
USE this in secondary objects ! 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 examples are: "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
Does a read with $question as prompt -- returns answer
Returns the absolute path for possible relative $file $reference is optional an defaults to $ENV{PWD}
Returns contents of $dir as a hash ref containing : 'files' => [@files], 'dirs' => [@dirs], 'rest' => [@rest], 'rest' are all files that are not (a symlink to) a file or dir
Called by plugins exit zoidberg -- this end a main_loop loop
Let all who are interrested know that event $event has taken place under conditions @args
register object $zoid_name for event $event_name
unregister object $zoid_name for event $event_name
list events for object $zoid_name
list objects for event $event_name
unregister object $zoid_name for all events
initialise a secundary object under name $zoidname of class $class and with arguments @args
Jaap Karssenberg || Pardus [Larus] <j.g.karssenberg@student.utwente.nl>
R.L. Zwart, <carlos@caremail.nl>
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.
perl
<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.