Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: How to change the color of the text

by toolic (Bishop)
on Sep 26, 2012 at 02:06 UTC ( #995665=note: print w/replies, xml ) Need Help??

in reply to How to change the color of the text

instead of using print
I don't understand your restriction, but I have used Term::ANSIColor
  • Comment on Re: How to change the color of the text

Replies are listed 'Best First'.
Re^2: How to change the color of the text
by PilotinControl25 (Initiate) on Sep 26, 2012 at 02:11 UTC

    I've inserted the ANSI code and it should display the whole output in another color correct? However it does not. What am I missing? Thanks.

    #!/usr/bin/perl use Term::ANSIColor qw(:constants); print GREEN, open (FILE, "railcardata.txt"); while (<FILE>) { chomp; ($roadname, $roadnumber, $cartype, $interrr) = split(":"); write; } close (FILE); format STDOUT_TOP = ====================================================================== ROAD NAME ROAD NUMBER CAR TYPE INTERCHANGE RAILROAD ====================================================================== . format STDOUT = @<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<<<<< @<<<<<<<<<<< $roadname, $roadnumber, $cartype, $interrr . sleep 12;
      "ANSI doesn't take"

      What do you mean by that?

      I've used ANSI also with great success...however I am stuck in this scenario no matter how I try and code it ANSI doesn't take...any suggestions in the code? thanks

      Maybe you ought to show that code?

      Does your terminal support ANSI escapes?

Re^2: How to change the color of the text
by PilotinControl25 (Initiate) on Sep 27, 2012 at 02:40 UTC

    I inserted the ansi code and it is not displaying green text please explain? thanks

      What operating system, what shell, what code?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://995665]
[Corion]: marioroy: Oh, that's always cool, having API-compatible modules. This makes testing and comparing things much easier
[marioroy]: IPC in MCE::Shared can handle 400k (sends) per second. That's seems a lot for being a pure-Perl module. After making the release, will come back and post a solution for a node by a fellow wanting faster logging.
[Corion]: While working on WWW::Mechanize:: Chrome, I had the suspicion that AnyEvent was doing something wrong, but I was able to swap it out for Mojolicious and the error persisted.
[Corion]: Of course, the error was in my own code ;)
[marioroy]: Corion, start and start_child in MCE::Hobo::Manager return a MCE::Hobo object, whereas P::FM returns the PID. I can have it return the PID though. I tried Hobo::Manager with several P::FM modules, just changed P::FM to MCE::Hobo::Manager and it works.
[marioroy]: I also have a Hobo driver for Forklift allowing folks to use in multiple classes, no conflicts with one another. That's not possible for P::FM.
[Discipulus]: congrats marioroy!

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2017-05-26 08:38 GMT
Find Nodes?
    Voting Booth?