in reply to Re^3: using colors with print()
in thread using colors with print()

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^5: using colors with print()
by pbeckingham (Parson) on Jun 19, 2004 at 20:31 UTC

    Given the caveat that this is not portable, you specified 'Linux' and 'Terminal', and that you wanted non-modular, try this:

    #! /usr/bin/perl -w use strict; print ' ', map (" $_ ", 40..47), "\n"; for my $fg (30..37, map {"1;$_"} 30..37) { printf "%9s%s\n", $fg, join ('', map {"\e[${fg}m\e[${_}m Text \e[0m"} 40..47); }
    I don't have the kind of patience that tachyon has, so I won't simulate the output, but imagine a labelled grid of foreground/background combinations that looks pretty.

Re^5: using colors with print()
by tachyon (Chancellor) on Jun 20, 2004 at 04:50 UTC
    1. Why not modular? Modules tend to be working, tested and stable.
    2. You do understand RTFS (it's no more than a handful of lines)?
    3. There is no reason why you can't Cut and Paste what you want?

    If installing modules seems problematic see A Guide to Installing Modules. If you for some reason want to inline the code or write your own functions a Module that does stuff you want is generally a good place to start your R&D (Rip-off & Duplication ;-)

    cheers

    tachyon

      the code that i'm building needs some modules to install i don't want to add other modules (that need an installation).