James Edward Gray II wrote: > On Dec 17, 2003, at 11:25 AM, Steve Massey wrote: > >> Hi All >> >> using Term:ANSIColor - does anyone know if it's possible ( or maybe >> I mean practical) to print out negative numbers in say RED, at the >> same time ensuring the original value is retained. >> >> so if value is -16 the it should print 16 in RED text otherwise >> leave it alone. How do you get it to actually do the color? I use both std command( w2k) and older version os MKS Korn shell and all I get is numbers. Never understood how one actually gets the colors etc.
What does one need to do? Thanks. Wags ;) > > Sure. > > use Term::ANSIColor; > > my $value = -16; > > if ($value >= 0) { print "$value\n"; } > else { print colored(abs($value), 'red'), "\n"; } > > Hope that helps. > > James ********************************************************** This message contains information that is confidential and proprietary to FedEx Freight or its affiliates. It is intended only for the recipient named and for the express purpose(s) described therein. Any other use is prohibited. **************************************************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>