Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

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

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (4)
As of 2017-02-24 01:50 GMT
Find Nodes?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?

    Results (351 votes). Check out past polls.