line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Text::ANSI::Printf; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
12546
|
use v5.14; |
|
5
|
|
|
|
|
42
|
|
4
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
139
|
|
5
|
5
|
|
|
5
|
|
25
|
use Carp; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
551
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = "1.03"; |
8
|
|
|
|
|
|
|
|
9
|
5
|
|
|
5
|
|
35
|
use Exporter 'import'; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
566
|
|
10
|
|
|
|
|
|
|
our @EXPORT_OK = qw(&ansi_printf &ansi_sprintf); |
11
|
|
|
|
|
|
|
|
12
|
0
|
|
|
0
|
1
|
0
|
sub ansi_printf { &printf (@_) } |
13
|
18
|
|
|
18
|
1
|
34286
|
sub ansi_sprintf { &sprintf(@_) } |
14
|
|
|
|
|
|
|
|
15
|
5
|
|
|
5
|
|
2393
|
use Text::VisualPrintf; |
|
5
|
|
|
|
|
221393
|
|
|
5
|
|
|
|
|
274
|
|
16
|
5
|
|
|
5
|
|
2281
|
use Text::ANSI::Fold::Util; |
|
5
|
|
|
|
|
4373
|
|
|
5
|
|
|
|
|
305
|
|
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub sprintf { |
19
|
78
|
|
|
78
|
1
|
113234
|
local $Text::VisualPrintf::IS_TARGET = qr/[\e\b\P{ASCII}]/; |
20
|
78
|
|
|
|
|
200
|
local $Text::VisualPrintf::VISUAL_WIDTH = \&Text::ANSI::Fold::Util::width; |
21
|
78
|
|
|
|
|
234
|
Text::VisualPrintf::sprintf(@_); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub printf { |
25
|
0
|
0
|
|
0
|
1
|
|
my $fh = ref($_[0]) =~ /^(?:GLOB|IO::)/ ? shift : select; |
26
|
0
|
|
|
|
|
|
$fh->print(&sprintf(@_)); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |