The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

Zoidscript

Since Zoidberg does not do the language interpreting itself -- it uses perl to do this -- there is no real independent zoidscript language. Context ZOID is almost the same as context PERL, the only real difference is that context PERL gets the prefix no strict before evalling.

But ...

Zoidberg does do some preprocessing before evalling a block of context ZOID, it does even do the same preprocessing before before evalling a block perl.

The exact parsing is configged by {grammar}{eval_zoid_gram} but by default it goes as follows:

There are two extra namespaces defined:

one by the regex: (?<![\w\}\)\]])->

and a second by the pound sign £ (as oppossed to the dollar sign $)

If the {core}{show_naked_zoid} bit is false, these two are interpreted the same.

The £ namespace

This name space includes some subs and vars from the zoidberg parent object but maps all other vars assigned to it to the {vars} hash.

Subs and vars that are visible on this not-naked zoid are listed in {core}{clothes}. One can add or remove these clothes in a simple way using the hide and un_hide commands.

Also there is a £_ variable, which is analogue to $_ but has a broader meaning. For perl and zoid blocks £_ equals $_ but in contrast to $_, £_ also can be used accross blocks and is in some cases defined for other contexts as well.

On YAPC::Europe::2002 we heard Larry mumble how he would love to use all kinds of UTF8 brackets to create a nice perl6 syntax. As it turns out there are still ascii chars unused in perl :) Makes you wonder how perl would have looked if larry had a european keyboard instead of plain old qwerty.

The -> namespace

As stated above unless {core}{show_naked_zoid} is true this namespace behaves the same as the the £ namespace.

Both once zoid is shown naked this becomes a abbreviation for $self->. This allows one to call any function of Zoidberg, or of one of the plugins in a straigthforward manner from the commandline.

Of course one always can use $self->sub to call functions of Zoidberg in perl and zoid blocks, but not only is -> 5 chars shorter then $self-> also it provides us with a perfect handle to force tab-expansion on $self. One should be aware though that this namespace limits the usage of white space in object-oriented perl code -- we think this is but a small sacrafice to save 5 chars.

Possibly there will be a "strict_perl" bit sometime in the future -- bug me if you need it.

Examples

zoid> £{my_var} = "home/pardus/my_script.pl" ; ls -al £_

-rw-r--r-- 1 pardus users 44 Oct 30 16:58 /home/pardus/my_script.pl

zoid> £{Some_var} = "some string" && perl{print $self->{vars}{some_var}}

Some string

zoid> _unhide list_clothes

zoid> _print ->list_clothes

->list_clothes = [ [ '{config}', '{core}', '{grammar}', 'list_clothes' ] ];

Note

One should notice that the shielding of the parent Zoidberg object, as provided when {core}{show_naked_zoid} is false, provides no security of any kind. After all it is perl and there are numerous ways to hack around. Its just makes typing faster and the amount of possibilities for tab-expansion smaller.