line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::ANSI::Printf; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
9558
|
use v5.14; |
|
4
|
|
|
|
|
30
|
|
4
|
4
|
|
|
4
|
|
23
|
use warnings; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
96
|
|
5
|
4
|
|
|
4
|
|
22
|
use Carp; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
424
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = "1.01"; |
8
|
|
|
|
|
|
|
|
9
|
4
|
|
|
4
|
|
28
|
use Exporter 'import'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
469
|
|
10
|
|
|
|
|
|
|
our @EXPORT_OK = qw(&ansi_printf &ansi_sprintf); |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
0
|
1
|
0
|
sub ansi_printf { &printf (@_) } |
13
|
18
|
|
|
18
|
1
|
31065
|
sub ansi_sprintf { &sprintf(@_) } |
14
|
|
|
|
|
|
|
|
15
|
4
|
|
|
4
|
|
1866
|
use Text::VisualPrintf; |
|
4
|
|
|
|
|
137931
|
|
|
4
|
|
|
|
|
203
|
|
16
|
4
|
|
|
4
|
|
1807
|
use Text::ANSI::Fold::Util; |
|
4
|
|
|
|
|
29219
|
|
|
4
|
|
|
|
|
659
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub sprintf { |
19
|
61
|
|
|
61
|
1
|
72817
|
local $Text::VisualPrintf::VISUAL_WIDTH = \&Text::ANSI::Fold::Util::width; |
20
|
61
|
|
|
|
|
187
|
Text::VisualPrintf::sprintf(@_); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub printf { |
24
|
0
|
0
|
|
0
|
1
|
|
my $fh = ref($_[0]) =~ /^(?:GLOB|IO::)/ ? shift : select; |
25
|
0
|
|
|
|
|
|
$fh->print(&sprintf(@_)); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
1; |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
__END__ |