Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Answer: How do I print characters with underline or bold?

by ariels (Curate)
on Aug 20, 2001 at 16:11 UTC ( #106194=categorized answer: print w/replies, xml ) Need Help??

Q&A > input and output > How do I print characters with underline or bold? - Answer contributed by ariels

Use Term::Cap. It's standard with all Perls (Term::ANSIColor seems to require 5.6) and it works with all terminal types, as it's based on termcap.
use Term::Cap; use POSIX; my $termios = new POSIX::Termios; $termios->getattr; my $ospeed = $termios->getospeed; my $t = Tgetent Term::Cap { TERM => undef, OSPEED => $ospeed }; ($norm, $under, $bold) = map { $t->Tputs($_,1) } qw/me md us/; print "${under}Underlined ${bold}bold$norm text (just ${bold}bold$norm +)"'
Also of interest might be the code ue (underline end). Read the termcap manual in section 4 or 5 of your nearest UN*X system's man command for more codes than you'd have thought useful.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2016-10-01 01:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (574 votes). Check out past polls.