| 1 | Term::ANSIColor version 1.04 |
| 2 | (A simple ANSI text attribute control module) |
| 3 | |
| 4 | Copyright 1996, 1997, 1998, 2000, 2001 Russ Allbery <rra@stanford.edu> |
| 5 | and Zenin <zenin@bawdycaste.org>. This program is free software; you |
| 6 | may redistribute it and/or modify it under the same terms as Perl |
| 7 | itself. |
| 8 | |
| 9 | |
| 10 | INTRODUCTION |
| 11 | |
| 12 | This module grew out of a thread on comp.lang.perl.misc where several of |
| 13 | us were throwing around different ways to print colored text from Perl |
| 14 | scripts and Zenin posted his old library to do that. I (Russ) disagreed |
| 15 | with the implementation and offered my own (the color() and colored() |
| 16 | functions implemented in this package), Zenin convinced me that the |
| 17 | constants had their place as well, and we started figuring out the best |
| 18 | ways of implementing both. |
| 19 | |
| 20 | While ANSI color escape codes are fairly simple, it can be hard to |
| 21 | remember the codes for all of the attributes and the code resulting from |
| 22 | hard-coding them into your script is definitely difficult to read. This |
| 23 | module is designed to fix those problems, as well as provide a convenient |
| 24 | interface to do a few things for you automatically (like resetting |
| 25 | attributes after the text you print out so that you don't accidentally |
| 26 | leave attributes set). |
| 27 | |
| 28 | Despite its name, this module can also handle non-color ANSI text |
| 29 | attributes (bold, underline, reverse video, and blink). It uses either of |
| 30 | two interfaces, one of which uses "constants" for each different attribute |
| 31 | and the other of which uses two subs which take strings of attributes as |
| 32 | arguments. |
| 33 | |
| 34 | See the POD documentation for complete details, features, and usage. |
| 35 | |
| 36 | |
| 37 | INSTALLATION |
| 38 | |
| 39 | Follow the standard installation procedure for Perl modules, which is to |
| 40 | type the following commands: |
| 41 | |
| 42 | perl Makefile.PL |
| 43 | make |
| 44 | make test |
| 45 | make install |
| 46 | |
| 47 | You'll probably need to do the last as root. If instead you wish to |
| 48 | install the module by hand, simply copy it into a directory named Term in |
| 49 | your Perl library directory. |
| 50 | |
| 51 | Note that make install, for Perl 5.6.0 or later, will replace the |
| 52 | Term::ANSIColor that came with Perl. You may wan to save a backup copy |
| 53 | of the standard version first. |
| 54 | |
| 55 | |
| 56 | THANKS |
| 57 | |
| 58 | To Jon Lennox for looking at early versions of this module, providing |
| 59 | feedback, and offering suggestions for improvement. |
| 60 | |
| 61 | To Jesse Taylor for writing the first significant script to use this |
| 62 | module (colorized calsplit), thus offering innumerable opportunities to |
| 63 | test and debug. |
| 64 | |
| 65 | To Jean Delvare for providing documentation of what the various |
| 66 | attributes do on various different terminal emulators, and for noting |
| 67 | that attribute 2 is dark. |
| 68 | |
| 69 | To Edward Avis for the implementation of uncolor. |
| 70 | |
| 71 | To Rani Pinchuk for the idea of ANSI_COLORS_DISABLED and an initial |
| 72 | implementation. |
| 73 | |
| 74 | To Larry Wall, as always, for Perl. |
| 75 | |
| 76 | Russ Allbery |
| 77 | rra@stanford.edu |