EchoAngel has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks, I got some data that I outputed to screen and it is in a certain order. Is there a way to highlight/bold the output? ie like changing font? Meaning change the data that goes to STDOUT. any such feature in perl?

Replies are listed 'Best First'.
Re: changing output look
by Velaki (Chaplain) on Sep 17, 2004 at 23:10 UTC

    Sure! You can use Term::ANSIColor, which will allow you to output text in bold, color, what-have-you, for a terminal that supports those features.

    Here's a nifty example:

    #!/usr/bin/perl use strict; use warnings; use Term::ANSIColor qw(:constants); print BOLD,BLUE,"This",RESET," is bold and blue.\n",RESET; print "But ",RED,"this",RESET," is simply red.\n",RESET;

    Hope that helped,
    -v
    "Perl. There is no substitute."
Re: changing output look
by cfreak (Chaplain) on Sep 18, 2004 at 19:07 UTC

    It would help if you told us what kind of output? Output on a webpage? Console? TK App?

    Perl certainly has lots of features for changing display options, but we need to know what exactly it is you're doing first