I'm using Perl 5.22.1 with Win32::Console. I have scripts that run make and I thought it would be nice if I could output the errors in red. Win32::Console has handles for stdout and sterr so I thought I could give colors to the individual handles but if I modify stderr, then it also modifies stdout. Is there a way to do this with Win32::Console or another module.
test.pl
use strict;
use warnings;
use Win32::Console;
my $stdout = new Win32::Console(STD_OUTPUT_HANDLE);
my $stderr = new Win32::Console(STD_ERROR_HANDLE);
sub testOutput
{
print("Testing output\n");
system("ls error");
system("ls *.pl");
print("\n");
}
testOutput();
$stdout->Attr($FG_BLUE);
testOutput();
$stderr->Attr($FG_RED);
testOutput();
$stdout->Write("stdout print\n");
$stderr->Write("stderr print\n");
