File: void_attributes.pl

package info (click to toggle)
libterm-extendedcolor-perl 0.504-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 224 kB
  • sloc: perl: 1,036; makefile: 2
file content (41 lines) | stat: -rw-r--r-- 863 bytes parent folder | download | duplicates (2)
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";