in reply to Term::ANSIColor is awesome, but.. (need help)
Change the module to produce objects with stringification overloaded to return the original string (w/o color escapes). Override the output functions you use (like 'print'), to do something like:
sub ... { local( $Term::ANSIColor::InOutput ) = 1; return CORE::...( @_ ); }
and have the stringification include the color escapes if $InOutput is true.
- tye
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Term::ANSIColor is awesome, but.. (need help) (overload and override)
by mascip (Pilgrim) on Mar 30, 2014 at 21:44 UTC | |
by mascip (Pilgrim) on Mar 31, 2014 at 14:35 UTC | |
by mascip (Pilgrim) on Apr 01, 2014 at 12:34 UTC | |
by tye (Sage) on Apr 01, 2014 at 13:44 UTC | |
by mascip (Pilgrim) on Apr 01, 2014 at 14:52 UTC |