line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Template::Caribou::Utils; |
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:YANICK'; |
3
|
|
|
|
|
|
|
# ABSTRACT: internal utilities for Template::Caribou |
4
|
|
|
|
|
|
|
$Template::Caribou::Utils::VERSION = '1.2.1'; |
5
|
|
|
|
|
|
|
|
6
|
13
|
|
|
13
|
|
52
|
use strict; |
|
13
|
|
|
|
|
85
|
|
|
13
|
|
|
|
|
331
|
|
7
|
13
|
|
|
13
|
|
41
|
use warnings; |
|
13
|
|
|
|
|
12
|
|
|
13
|
|
|
|
|
311
|
|
8
|
13
|
|
|
13
|
|
39
|
no warnings qw/ uninitialized /; |
|
13
|
|
|
|
|
11
|
|
|
13
|
|
|
|
|
506
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
BEGIN { |
11
|
13
|
|
|
13
|
|
219
|
*::RAW = *::STDOUT; |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
13
|
|
|
13
|
|
46
|
use parent 'Exporter::Tiny'; |
|
13
|
|
|
|
|
17
|
|
|
13
|
|
|
|
|
85
|
|
15
|
|
|
|
|
|
|
|
16
|
13
|
|
|
13
|
|
37552
|
use experimental 'signatures'; |
|
13
|
|
|
|
|
33266
|
|
|
13
|
|
|
|
|
55
|
|
17
|
|
|
|
|
|
|
|
18
|
13
|
|
|
13
|
|
1431
|
use Carp; |
|
13
|
|
|
|
|
16
|
|
|
13
|
|
|
|
|
1336
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package |
22
|
|
|
|
|
|
|
Template::Caribou::String; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
use overload |
25
|
122
|
|
|
122
|
|
1526
|
'""' => sub { return ${$_[0] } }, |
|
122
|
|
|
|
|
449
|
|
26
|
13
|
|
|
13
|
|
57
|
'eq' => sub { ${$_[0]} eq $_[1] }; |
|
13
|
|
|
53
|
|
16
|
|
|
13
|
|
|
|
|
143
|
|
|
53
|
|
|
|
|
13438
|
|
|
53
|
|
|
|
|
450
|
|
27
|
|
|
|
|
|
|
|
28
|
117
|
|
|
117
|
|
829
|
sub new { my ( $class, $string ) = @_; bless \$string, $class; } |
|
117
|
|
|
|
|
293
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
package |
32
|
|
|
|
|
|
|
Template::Caribou::Output; |
33
|
|
|
|
|
|
|
|
34
|
13
|
|
|
13
|
|
1230
|
use parent 'Tie::Handle'; |
|
13
|
|
|
|
|
16
|
|
|
13
|
|
|
|
|
50
|
|
35
|
|
|
|
|
|
|
|
36
|
149
|
|
|
149
|
|
406
|
sub TIEHANDLE { return bless \my $i, shift; } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub escape { |
39
|
13
|
|
|
13
|
|
22494
|
no warnings qw/ uninitialized/; |
|
13
|
|
|
|
|
17
|
|
|
13
|
|
|
|
|
1643
|
|
40
|
|
|
|
|
|
|
@_ = map { |
41
|
120
|
|
|
120
|
|
188
|
my $x = $_; |
|
120
|
|
|
|
|
132
|
|
42
|
120
|
|
|
|
|
168
|
$x =~ s/&/&/g; |
43
|
120
|
|
|
|
|
147
|
$x =~ s/</</g; |
44
|
120
|
|
|
|
|
288
|
$x; |
45
|
|
|
|
|
|
|
} @_; |
46
|
|
|
|
|
|
|
|
47
|
120
|
100
|
|
|
|
767
|
return wantarray ? @_ : join '', @_; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
21
|
|
|
21
|
|
121
|
sub PRINT { shift; print ::RAW escape( @_ ) } |
|
21
|
|
|
|
|
49
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
package |
53
|
|
|
|
|
|
|
Template::Caribou::OutputRaw; |
54
|
|
|
|
|
|
|
|
55
|
13
|
|
|
13
|
|
55
|
use parent 'Tie::Handle'; |
|
13
|
|
|
|
|
19
|
|
|
13
|
|
|
|
|
53
|
|
56
|
|
|
|
|
|
|
|
57
|
149
|
|
|
149
|
|
364
|
sub TIEHANDLE { return bless \my $i, shift; } |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
sub PRINT { |
60
|
85
|
|
|
85
|
|
84
|
shift; |
61
|
13
|
|
|
13
|
|
975
|
no warnings qw/ uninitialized /; |
|
13
|
|
|
|
|
20
|
|
|
13
|
|
|
|
|
636
|
|
62
|
85
|
|
|
|
|
314
|
$Template::Caribou::OUTPUT .= join '', @_, $\; |
63
|
|
|
|
|
|
|
} |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
1; |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
__END__ |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=pod |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=encoding UTF-8 |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 NAME |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Template::Caribou::Utils - internal utilities for Template::Caribou |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 VERSION |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
version 1.2.1 |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 DESCRIPTION |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
Used internally by L<Template::Caribou>. Nothing interesting |
84
|
|
|
|
|
|
|
for end-users. |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
=head1 AUTHOR |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
Yanick Champoux <yanick@cpan.org> |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Yanick Champoux. |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
95
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=cut |