The Triumphant Return of Zoidberg -- A Modular Perl Shell

After more than a year of hoping to be able to say this, here goes: Zoidberg is back!

What is Zoidberg you ask? Well its a Perl shell, of course. Think of the fun of it all:

mv($_ => lc($_)) for grep /[A-Z]/, <*>

If you use a reserved Perl word first or if you wrap code in a block it is interpreted as Perl, if not then its a shell command. Along with having most of the things you would expect from a shell, it features plenty of extra bells and whistles, like a multiline input system (when Term::ReadLine::Zoid, part of Bundle::Zoidberg, is installed) and automatic splitting of variables to arrays like @PATH which is just $ENV{PATH} split on :.

When used as your login shell, it can be used from inside other programs like vim.

:!cat % | {/^\S/}g | wc -

Further, it is easy to extend with the Zoidberg::Fish plugin system.

Read plenty more about it in a couple of rather old, but still relevant articles:

Zoidberg had developed a few warts over the years, which have been fixed. I also noticed a few things which needed immediate work, which has been done. There is plenty more to do, but Jaap was close to declaring it stable back in 2006, so it is very usable already.

Some of the TODOs include modernizing parts of the test suite and investigating the viability of using some standard modules, like Devel::REPL, Moose, and Getopt::Long to bring zoid into the world of Modern Perl.

It is a testament to the stability of Perl that after all these years without maintenance that it took so little work to get it going again. Please enjoy Zoidberg and let me know what you think of it, or of course of any problems you have.

To try it, you can simply install with:

cpanm Bundle::Zoidberg

and the repo is on GitHub, so fork away!

For some more info start at the zoiduser man page. Then run zoid to take it for a spin!

9 Comments

++

I have not checked it yet but I hope this works on Windows as well…

Good job! Thanks for that, and I hope to see more. I did not take a very close look at Zoidberg, but I hope to soon. Right now I’m still using Bash.

Note that converting to Moose may not be a good idea in this context, due to its negative effect on the startup time. I’m not sure how much it will matter, but there’s always Mouse and Moo and stuff like that.

Freaking awesome!

I’ve been wanting a more powerful shell (and damned if I’m gonna learn all the nits and picks of obscure Bash syntax).

Thank you to putting much work into it!

I agree with Shlomi that you should consider Mouse (or even Moo) since they take much less in startup, and you probably don’t need full-on Moose. I might be able to help with moving it to that direction.

i could’t install under windows https://gist.github.com/1467050 but it’s very interesting

Just add another digit. :-)

w00t!

Once every few years, I play with the idea of making a Perl shell my main working shell env. The time has come to give it yet another try. :-)

I force installed out of curiosity. It uses a function not available on Windows:

The getpwuid function is unimplemented at C:\Perl-5.14\perl\site\bin/zoid.bat line 101.

Apparently Win32::pwent implements getpwuid(). This will fail to build because of a declared dependency on the obsolete Win32::Registry, but it can be force installed if Win32::TieRegistry is present, and passes all tests.

Leave a comment

About Joel Berger

user-pic As I delve into the deeper Perl magic I like to share what I can.