CODE
use Term::ANSIColor;
print color 'bold blue';
print "This text is bold blue.\n";
print color 'reset';
print "This text is normal.\n";
print colored ("Yellow on magenta.", 'yellow on_magenta'), "\n";
print "This text is normal.\n";
print colored ['yellow on_magenta'], 'Yellow on magenta.';
print "\n";
use Term::ANSIColor qw(uncolor);
print uncolor '01;31', "\n";
use Term::ANSIColor qw(:constants);
print BOLD, BLUE, "This text is in bold blue.\n", RESET;
use Term::ANSIColor qw(:constants);
$Term::ANSIColor::AUTORESET = 1;
print BOLD BLUE "This text is in bold blue.\n";
print "This text is normal.\n";
I want to color or highlight output text using perl. I downloaded the module ANSIColor. And tried the above code that I collected from CPAN. I tried running the program both in perl text editor and command prompt. But I am not able to get coloured text.
Plz help me. Is there a problem with the text editor or command prompt? I downloaded the ANSIColor module, but not Term::ANSIColor bcoz I am not able to get it. Does that make a difference?
Plz help me.