line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
53984
|
use 5.008; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
112
|
|
2
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
45
|
|
3
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
96
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package String::Interpolate::Delayed; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = "cpan:TOBYINK"; |
8
|
|
|
|
|
|
|
our $VERSION = "0.001"; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $WORKAROUND = 1; |
11
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
2310
|
use overload q[""] => "interpolated", fallback => 1; |
|
1
|
|
|
|
|
1659
|
|
|
1
|
|
|
|
|
7
|
|
13
|
|
|
|
|
|
|
|
14
|
1
|
|
|
1
|
|
1216
|
use PadWalker (); |
|
1
|
|
|
|
|
1217
|
|
|
1
|
|
|
|
|
30
|
|
15
|
1
|
|
|
1
|
|
1487
|
use PerlX::QuoteOperator (); |
|
1
|
|
|
|
|
81248
|
|
|
1
|
|
|
|
|
26
|
|
16
|
1
|
|
|
1
|
|
1856
|
use String::Interpolate (); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
use UNIVERSAL::ref; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub import |
20
|
|
|
|
|
|
|
{ |
21
|
|
|
|
|
|
|
my $class = shift; |
22
|
|
|
|
|
|
|
my ($name) = @_; |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
my $code = sub ($) { |
25
|
|
|
|
|
|
|
my $text = shift; |
26
|
|
|
|
|
|
|
bless \$text; |
27
|
|
|
|
|
|
|
}; |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
"PerlX::QuoteOperator"->new->import( |
30
|
|
|
|
|
|
|
$name || "delayed", |
31
|
|
|
|
|
|
|
{ -emulate => 'q', -with => $code }, |
32
|
|
|
|
|
|
|
scalar caller, |
33
|
|
|
|
|
|
|
); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
sub new |
37
|
|
|
|
|
|
|
{ |
38
|
|
|
|
|
|
|
my $class = shift; |
39
|
|
|
|
|
|
|
my ($text) = @_; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
bless \$text => $class; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub uninterpolated |
45
|
|
|
|
|
|
|
{ |
46
|
|
|
|
|
|
|
my $self = shift; |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
return $$self; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub _clean |
52
|
|
|
|
|
|
|
{ |
53
|
|
|
|
|
|
|
my ($refs) = @_; |
54
|
|
|
|
|
|
|
+{ map {; substr($_, 1) => $refs->{$_} } keys %$refs }; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub interpolated |
58
|
|
|
|
|
|
|
{ |
59
|
|
|
|
|
|
|
my $self = shift; |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
my $stri = "String::Interpolate"->new; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
if ($WORKAROUND) { |
64
|
|
|
|
|
|
|
# Workaround for bug in the ->pragma() accessor... |
65
|
|
|
|
|
|
|
$$stri->{pragmas} = 'import strict "vars";'; |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
else { |
68
|
|
|
|
|
|
|
$$stri->pragma('import strict "vars";'); |
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
$stri->exec( |
72
|
|
|
|
|
|
|
_clean(PadWalker::peek_our 1), |
73
|
|
|
|
|
|
|
_clean(PadWalker::peek_my 1), |
74
|
|
|
|
|
|
|
grep(ref($_) eq 'HASH', @_), |
75
|
|
|
|
|
|
|
); |
76
|
|
|
|
|
|
|
return $stri->exec($$self); |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
sub ref |
80
|
|
|
|
|
|
|
{ |
81
|
|
|
|
|
|
|
return undef; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
1 && __PACKAGE__ |
85
|
|
|
|
|
|
|
__END__ |