1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
|
#!/usr/bin/perl
use strict;
use warnings FATAL => 'all';
use autodie qw(:all);
use Term::ExtendedColor qw(:attributes);
# demonstrates calling attr functions in void context this should look
# exactly the same in xterm, urxvt, vte...
my $bold = bold('this is bold');
$bold =~ s{(bold)}{bold()
. fg(196, underline('not'))
. ' '
. bold()
. $1
. ' /'
. italic('anymore')
. '/'}e;
print "$bold\n";
print "> No attributes here\n";
print join(' ',
bold('bold'),
italic('italic'),
underline('underline'),
inverse('inverse'),
), "\n";
print "> Term::ExtendedColor::autoreset OFF\n";
Term::ExtendedColor::autoreset(0);
print join(' ',
bold('bold'),
italic('italic'),
underline('underline'),
inverse('inverse'),
), "\n";
|