Subject: | Example for uncolor() does not work as documented. |
Date: | Fri, 10 Jan 2020 00:16:42 -0800 |
To: | bug-Term-ANSIColor [...] rt.cpan.org |
From: | Joe Smith <joeinwap [...] gmail.com> |
This example does not work:
# Map escape sequences back to color names.
use Term::ANSIColor 1.04 qw(uncolor);
my $names = uncolor('01;31');
print join(q{ }, @{$names}), "\n";
In scalar context, uncolor() returns the list size
instead of an array reference. Adding "use strict;" the
error is "cannot use string '2' as an array reference".
The function works as expected when using @names instead.
Reference:
Term::ANSIColor 5.00 released
https://www.nntp.perl.org/group/perl.perl5.porters/2020/01/msg256833.html