Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

what does "\e[...." mean?

by skyworld_chen (Acolyte)
on Oct 29, 2012 at 08:16 UTC ( #1001315=perlquestion: print w/ replies, xml ) Need Help??
skyworld_chen has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I see a piece of code as

 die "\e[5;31;42m ERROR: $lib_setup FILE does not exist in DIRECTORY: $setupDir/\e[0m\n" unless (-f "$setupDir/$lib_element");

can anybody help me to understand the symbol for "\e[5;31;42m" mean? thanks

Comment on what does "\e[...." mean?
Download Code
Replies are listed 'Best First'.
Re: what does "\e[...." mean?
by tobyink (Abbot) on Oct 29, 2012 at 08:21 UTC

    It's an escape code that may change the colour of the output text (depending on the terminal which the program is running in).

    Voodoo really; use Term::ANSIColor instead.

    perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
Re: what does "\e[...." mean?
by BrowserUk (Pope) on Oct 29, 2012 at 08:18 UTC

    See ANSI escape codes

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

      thanks for your and tobyink's reply

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1001315]
Approved by Corion
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2015-11-30 04:21 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (757 votes), past polls