Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

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

by ariels (Curate)
on Aug 20, 2001 at 16:11 UTC ( [id://106194]=note: print w/replies, xml ) Need Help??


in reply to How do I print characters with underline or bold?

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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://106194]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-19 17:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found