in reply to Re^5: How to print colored word in text file
in thread How to print colored word in text file
++hdb. For something different, I would use
Win32::Console::ANSI and
Term::ANSIColor::Print.
I don't have access to a Windows machine, so it isn't tested. Please let me know if it works for you.#!/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");
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^7: How to print colored word in text file
by soonix (Canon) on Jun 23, 2013 at 17:23 UTC | |
by Khen1950fx (Canon) on Jun 23, 2013 at 18:24 UTC | |
Re^7: How to print colored word in text file
by hdb (Monsignor) on Jun 24, 2013 at 06:39 UTC |
In Section
Seekers of Perl Wisdom