File: fall_through_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 (25 lines) | stat: -rw-r--r-- 582 bytes parent folder | download | duplicates (4)
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
#!/usr/bin/perl
# Demonstrates fall-through attributes

use strict;
use warnings FATAL => 'all';

use Term::ExtendedColor qw(:attributes);
Term::ExtendedColor::autoreset( 0 );

my $red    = fg('red1', 'Red');
my $green  = fg('green1', 'Green');

print "Text following $red is red until $green\n";
print 'Text is still green, ', bold('and now bold as well!'), "\n";

clear();

my $blue = bg('navyblue', 'Blue background ');
print $blue, fg('darkorange1', bold(', Bold, Orange foreground ')), "\n";

clear();

print underline('Underlined'), ' and ', italic('italic'), "\n";

clear();