App-pltest

 view release on metacpan or  search on metacpan

pod/examples.pod  view on Meta::CPAN

    pltest -OA '@d = (["A", 1189, 1682], ["B", 1414, 2000], ["C", 1297, 1834]); 0..10' \
        'form "  %3s  %4dmm x %4dmm" x 3,
            map +("$$_[0]$ARGV", ($$_[1], $$_[2]) = ($$_[2] / 2, $$_[1])), @d'

=item ANSI Background;Foreground Color Table

I<What color is a mirror?  It depends whom you ask. ;-)>

You get numbers to fill into C<"\e[BGm">, C<"\e[FGm"> or C<"\e[BG;FGm"> to get
a color and close it with C<"\e[m">.  There are twice twice 8 different colors
for dim & bright and for background & foreground.  Hence the multiplication of
escape codes and of values to fill them.

This fills C<@A(RGV)> in B<-A> twice, the 2nd time looping over the 1st list,
as though it had been given on the command line.  It maps it to the 16-fold
number format to print the header, swallowing every other number with 0-width.
Then the main program loops over it pairwise with C<$A(RGV)>, thanks to
B<-o2>, to print the body.  Numbers are duplicated with C<(N)x2>, once to go
into the escape sequence, once to be displayed:

    pltest -o2A 1..8 -A '$_, $_+39, $_+8, $_+99' -B 'form "co:   bg;fg"."%4d%.0s"x16, @ARGV;



( run in 0.864 second using v1.01-cache-2.11-cpan-f56aa216473 )