Dear wise ones,
I have created a utility written in Perl for use by members of my department. If it is invoked with a parameter of "-h" it writes help information to the screen. I have near the top of the script
use Term::ANSIColor qw (color colored colorstrip :constants);
which allows me to color keywords in the help text that is generated. When I display the help text, if I use the regular print function, strings like
"The purpose of the " . colored ("ts", "green") . " script is to ..."
work perfectly. However, I just tried using a format and the write instruction to generate the same information with better formatting, and found that the ANSII codes that are properly interpreted and rendered by the print instruction are being displayed by the write function as text, e.g.
The purpose of the [32mts [0m script is to search for a ...
Is there a way to use the write function and a format to display text with embedded ANSII codes being interpreted as control characters rather than as text?
Thank you.
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |