The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Term::GentooFunctions - provides gentoo's einfo, ewarn, eerror, ebegin and eend.


    use Term::GentooFunctions qw(:all)

    einfo "this is kinda neat...";

    ebegin "I hope this works...";
    eend $truefalse; # the result is backwards of gentoo; ie, 0 is bad, 1 is good.


einfo, ewarn, and eerror show informative lines with stars at the beginning colored green, yellow, and red (respectively).


ebegin and eend show the beginning and ends of things. ebegin also prints the given error message using einfo.

eend returns the result passed in for handy returns at the bottom of functions...

    sub eg {
        eend 0; # eg now returns a false!!  Huzzah!

eend will use $_ if it is not passed any arguments.


Print an error with eerror and exit(0x65).


You can also use eindent and eoutdent to show trees of things happening, example:

    einfo "something"
    einfo "something else" # indented
    einfo "something else (again)" # un-dented


edo is an extra magic function that aggregates several of the functions above:

    use IPC::System::Simple qw(systemx);
    edo "removing file" => sub {

        systemx(qw(rm file));


edo handles ebegin and eend automatically and catches errors for optional edie after execution. Nested edo functions will automatically eindent as well:

    edo test1 => sub {
        edo test2 => sub {
            systemx(qw(rm file));


Minor caveat: edie isn't catchable (see: eval) since it calls exit, therefore, inner death(s) should use die rather than edie.


Strictly speaking, these functions aren't in the real Gentoo script, but man they're handy.

    use Time::HiRes qw(sleep);
    start_spinner "testing the spinner";
    for (1 .. 20) {
        step_spinner; # spin the spinner
        # step_spinner "$_/20"; # optional msg arg
        sleep 0.1;
    end_spinner 1; # works just like eend


Term::GentooFunctions will use RC_INDENTATION and RC_DEFAULT_INDENT from Gentoo's /sbin/ So you can eindent in a and your will use the indent level! However, to get it to work you must first export them to your perl scripts:


Term::GentooFunctions will not be able to modify the indent level in a way that will propagate back up to bash -- that would technically be impossible through environment variables.


Paul Miller <>

I am using this software in my own projects... If you find bugs, please please please let me know. :) Actually, let me know if you find it handy at all. Half the fun of releasing this stuff is knowing that people use it.


Copyright (C) 2007-2010, Paul Miller,

This module is free software. You can redistribute it and/or modify it under the terms of the Artistic License 2.0.

This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose.


Term::Size, Term::ANSIColor, Term::ANSIScreen