in reply to Re^7: Ter::ANSIColor is awesome, but.. (need help)
in thread Term::ANSIColor is awesome, but.. (need help)
Oh yes, I just need a very thin wrapper. I should stop working on the weekend: I'm too tired to think. I imagined I'd have to refactor Term::ANSIColor into a class.
It could look like this instead (more generic):
I like the idea. But I read your advice and now I'm wondering.package String::Colored; sub new { my( $class, $string, $color )= @_; bless { string => $string, color => $color } => $class; }; sub stringify { my( $self )= @_; colored( $self->{ name }, $self->{$color} ); } sub eq { ... }
I'm heading back home, I'll think about this tonight.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: Ter::ANSIColor is awesome, but.. (need help)
by Corion (Patriarch) on Mar 30, 2014 at 16:24 UTC | |
by mascip (Pilgrim) on Mar 30, 2014 at 16:41 UTC | |
by Anonymous Monk on Mar 31, 2014 at 07:09 UTC | |
by mascip (Pilgrim) on Mar 31, 2014 at 14:30 UTC |