Escape Characters

Mark Fowler mark at
Thu Jan 16 17:15:44 GMT 2003

On Thu, 16 Jan 2003, Abdul Salam K wrote:

> How can I create Bold and Highlighted characters on the screen. I know it is
> created by some special characters like ^[. But, how can I get the keyboard
> sequence for these characters?.

I happened to have this open on my desktop while I was reading your email:

>From perl, you can create sequences like:

  perl -e 'print "\x1B[1m"'

Of course, if you're going to use Perl then you might as well use the
Term::ANSIColor module that ships with Perl.

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

The online documentation for that module is here:

One of the lightening talks at the upcoming London Perl Mongers Technical
meeting on Thursday Jan 23rd (week today) will deal with tricks you can
play with VT100 terminals and perl signatures...see
for more info.

Right, see you all in the pub.


#!/usr/bin/perl -T
use strict;
use warnings;
print q{Mark Fowler, mark at,};

More information about the Ukfreebsd mailing list