Hello Monks, I have the following code that I am testing on windows at the cmd prompt. I am trying to display bright colors, but when the bright color is called to print, it displays in white. So the first line displaysin green, but the 2nd line which I want to display in Bright Green, displays white. Any ideas on how to get it to be bright green?

#!/usr/bin/perl use if $^O eq 'MSWin32', Win32::Console::ANSI; use if $^O eq 'MSWin32', Term::ANSIColor => qw(:constants); if ($^O eq 'MSWin32') { $SUCCESS=GREEN; $BRIGHT_SUCCESS=BRIGHT_GREEN; $FAILURE=RED; $WARNING=YELLOW; $NORMAL=RESET; $cls='cls'; } else { $FAILURE=`echo -en "\\033[1;31m"`; $SUCCESS=`echo -en "\\033[1;32m"`; $WARNING=`echo -en "\\033[1;33m"`; $NORMAL=`echo -en "\\033[0;39m"`; $cls='clear'; } $RESULT="Test Line"; $line=sprintf("%s%s%s\n",$SUCCESS,$RESULT,$NORMAL); print $line; # <== This will print Green $line=sprintf("%s%s%s\n",$BRIGHT_SUCCESS,$RESULT,$NORMAL); print $line; # <== This will print White...not Bright Green

In reply to Term::ANSIColor not displaying BRIGHT colors by g_speran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.