Skip Menu |

This queue is for tickets about the Term-ANSIColor-Conditional CPAN distribution.

Report information
The Basics
Id: 127815
Status: resolved
Priority: 0/
Queue: Term-ANSIColor-Conditional

People
Owner: Nobody in particular
Requestors: alex.karelas [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: you only accept one form of parameters for 'colored'
Date: Tue, 27 Nov 2018 17:48:55 +0200
To: bug-Term-ANSIColor-Conditional [...] rt.cpan.org
From: Alexander Karelas <alex.karelas [...] gmail.com>
the original 'colored' (that of Term::ANSIColor) accepts two forms of parameters, you cover none of the two completely. First way: print colored('hi there', 'red'); Second way: print colored(['red'], 'hi ', 'there'); See the completely different outputs that this script produces, between when COLOR is 0 and when COLOR = 1: *#!/usr/bin/env perl** ** **use v5.10;** **use strict;** **use warnings;** ** **use Term::ANSIColor::Conditional;** ** **for (0, 1) {** **    $Term::ANSIColor::Conditional::COLOR = $_;** **    say colored(['red'], 'colored with array: ', 'hi ', 'there ');** **    say colored('yo man', 'red');** **}* This is quite an important bug, and hence needs fixing.
Subject: Re: you only accept one form of parameters for 'colored'
Date: Tue, 27 Nov 2018 17:52:56 +0200
To: bug-Term-ANSIColor-Conditional [...] rt.cpan.org
From: Alexander Karelas <alex.karelas [...] gmail.com>
Once more, without formatting: #!/usr/bin/env perl use v5.10; use strict; use warnings; use Term::ANSIColor::Conditional; for (0, 1) {     $Term::ANSIColor::Conditional::COLOR = $_;     say colored(['red'], 'colored with array: ', 'hi ', 'there ');     say colored('yo man', 'red'); }
Thanks for the patch/PR on GitHub, I've released a new version.