can you provide a Short, Self-Contained, Correct Example to show how you use format? I am uninitiated.
print with sprintf works fine for me:
use Term::ANSIColor qw (color colored colorstrip :constants); my $x = sprintf '%s XYZ', "Hello ".colored("there", "green")." and bye +."; print $x; print sprintf("123 %s 456 %s 789\n", colored("hello", "red").sprintf("abc %s xyz", colored("bye", "green") ), $x );
Dirty hack: re-escaping refreshing the ANSI escape sequence in The purpose of the [32mts [0m script... works for me with (the naive) =~ s/\[/\033[/g;
bw, bliako
In reply to Re: Is it possible to include colored text in formatted output using write
by bliako
in thread Is it possible to include colored text in formatted output using write
by fireblood
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |