Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,689 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,300 people online right now. Registration is fast and FREE... Join Now!




color or highlight text using perl

 
Reply to this topicStart new topic

color or highlight text using perl

shwetakagliwal
post 12 Jun, 2008 - 08:44 PM
Post #1


New D.I.C Head

*
Joined: 23 Dec, 2007
Posts: 5

CODE

use Term::ANSIColor;
    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.", 'yellow on_magenta'), "\n";
    print "This text is normal.\n";
    print colored ['yellow on_magenta'], 'Yellow on magenta.';
    print "\n";

    use Term::ANSIColor qw(uncolor);
    print uncolor '01;31', "\n";

    use Term::ANSIColor qw(:constants);
    print BOLD, BLUE, "This text is in bold blue.\n", RESET;

    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";




I want to color or highlight output text using perl. I downloaded the module ANSIColor. And tried the above code that I collected from CPAN. I tried running the program both in perl text editor and command prompt. But I am not able to get coloured text.
Plz help me. Is there a problem with the text editor or command prompt? I downloaded the ANSIColor module, but not Term::ANSIColor bcoz I am not able to get it. Does that make a difference?
Plz help me.
User is offlineProfile CardPM

Go to the top of the page

BetaWar
post 12 Jun, 2008 - 08:51 PM
Post #2


#include <soul.h>

Group Icon
Joined: 7 Sep, 2006
Posts: 1,987



Thanked 78 times

Dream Kudos: 1175
My Contributions


Sadly, I have very little knowledge of Perl, but I was able to find something online that may answer the question you have:

http://mandrivausers.org/index.php?showtopic=12935

Hope that helps.
User is offlineProfile CardPM

Go to the top of the page

shwetakagliwal
post 12 Jun, 2008 - 10:59 PM
Post #3


New D.I.C Head

*
Joined: 23 Dec, 2007
Posts: 5

Dear Beta War,
Thanks for your help.
But Icould not find it helpful.
I am still unable to get the desired output.
Plz help
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 07:32AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month