Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

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

( #106194=categorized answer: print w/ replies, xml ) Need Help??

Q&A > input and output > How do I print characters with underline or bold? 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.

Comment on Answer: How do I print characters with underline or bold?
Download Code
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 imbibing at the Monastery: (14)
As of 2015-07-01 21:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (22 votes), past polls