A
alex
I'd like to colour my output. Term::ANSIColor looks great,
but unfortunately i'm on windows using cmd.exe and it doesn't want
to interpret the colour codes. Other than changing shell,
is there anyway i can get a coloured output?
The best idea i've come up with is to pipe my ouput thro' "more":
# code borrowed from Term::ANSIColor docs
use Term::ANSIColor;
open STDOUT, "|more" or die "Can't redirect STDOUT: $!"; # !!!
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.\n", 'yellow on_magenta');
print "This text is normal.\n";
print colored ['yellow on_magenta'], "Yellow on magenta.\n";
which works, but i'm wondering if i can do what "more" is
doing in Perl without resorting to an external process.
Many thanks!
but unfortunately i'm on windows using cmd.exe and it doesn't want
to interpret the colour codes. Other than changing shell,
is there anyway i can get a coloured output?
The best idea i've come up with is to pipe my ouput thro' "more":
# code borrowed from Term::ANSIColor docs
use Term::ANSIColor;
open STDOUT, "|more" or die "Can't redirect STDOUT: $!"; # !!!
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.\n", 'yellow on_magenta');
print "This text is normal.\n";
print colored ['yellow on_magenta'], "Yellow on magenta.\n";
which works, but i'm wondering if i can do what "more" is
doing in Perl without resorting to an external process.
Many thanks!