++
hdb. For something different, I would use
Win32::Console::ANSI and
Term::ANSIColor::Print.
#!/usr/bin/perl
BEGIN {
$| = 1;
$^W = 1;
eval {
require Readonly;
};
}
use strict;
use warnings;
use Win32::Console::ANSI;
use Term::ANSIColor::Print;
my $print = Term::ANSIColor::Print->new();
$print->bold_blue( "This text is bold blue." );
$print->normal( "This text is normal" );
$print->bold_yellow_on_magenta(
"This text is bold yellow on magenta",
);
$print->normal( "This text is normal." );
print "To print a specific word such as ERROR in red: ";
$print->red("ERROR");
I don't have access to a Windows machine, so it isn't tested. Please let me know if it works for you.