Hi
i want to print the text in different color using perl script.
i am able to print on console(terminal).
but if i try to print the same into a file, i am not able to do
color.pl
#!/bin/usr/perl
use Term::ANSIColor;
print "This text is normal.\n";
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";
if try the following
#!/bin/usr/perl
use Term::ANSIColor;
open (OUT,">cl.txt");
print OUT "This text is normal.\n";
use Term::ANSIColor qw(:constants);
$Term::ANSIColor::AUTORESET = 1;
print OUT BOLD BLUE "This text is in bold blue.\n";
print OUT "This text is normal.\n";
close(OUT);
vi cl.txt
This text is normal.
^[[1m^[[34mThis text is in bold blue.
^[[0m^[[0mThis text is normal.
i am not getting output in color inside the file cl.txt
thanks
roopa