line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tie::LazyFunction; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6600
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
31
|
|
5
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
651
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.01'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub TIESCALAR{ |
10
|
5
|
|
|
5
|
|
241
|
shift; |
11
|
5
|
50
|
|
|
|
15
|
@_ == 1 and return bless [$_[0]], 'Tie::LazyFunction'; |
12
|
5
|
100
|
|
|
|
47
|
@_ == 2 and return bless [$_[0],\($_[ 1 ] )], 'Tie::LazyFunction::1'; |
13
|
3
|
100
|
|
|
|
17
|
@_ == 3 and return bless [$_[0],\(@_[ 1 .. 2 ] )], 'Tie::LazyFunction::2'; |
14
|
2
|
50
|
|
|
|
7
|
@_ == 4 and return bless [$_[0],\(@_[ 1 .. 3 ] )], 'Tie::LazyFunction::3'; |
15
|
2
|
50
|
|
|
|
6
|
@_ == 5 and return bless [$_[0],\(@_[ 1 .. 4 ] )], 'Tie::LazyFunction::4'; |
16
|
2
|
50
|
|
|
|
5
|
@_ == 6 and return bless [$_[0],\(@_[ 1 .. 5 ] )], 'Tie::LazyFunction::5'; |
17
|
2
|
50
|
|
|
|
6
|
@_ == 7 and return bless [$_[0],\(@_[ 1 .. 6 ] )], 'Tie::LazyFunction::6'; |
18
|
2
|
|
|
|
|
24
|
return bless [$_[0],\(@_[ 1 .. $#_ ] )], 'Tie::LazyFunction::n'; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub FETCH{ |
22
|
0
|
|
|
0
|
|
0
|
my $ar = shift; |
23
|
|
|
|
|
|
|
# do the coderef in $ar->[0] with no arguments |
24
|
0
|
|
|
|
|
0
|
&{$ar->[0]}; |
|
0
|
|
|
|
|
0
|
|
25
|
|
|
|
|
|
|
}; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub Tie::LazyFunction::1::FETCH{ |
28
|
6
|
|
|
6
|
|
90
|
my $ar = shift; |
29
|
|
|
|
|
|
|
# do the coderef in $ar->[0] with arguments from $ar->[1..] |
30
|
6
|
|
|
|
|
17
|
&{$ar->[0]}( |
|
6
|
|
|
|
|
11
|
|
31
|
6
|
|
|
|
|
8
|
${ $ar->[1] } |
32
|
|
|
|
|
|
|
); |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub Tie::LazyFunction::2::FETCH{ |
36
|
2
|
|
|
2
|
|
39
|
my $ar = shift; |
37
|
2
|
|
|
|
|
5
|
&{$ar->[0]}( |
|
2
|
|
|
|
|
5
|
|
38
|
2
|
|
|
|
|
3
|
${ $ar->[1] } , |
39
|
2
|
|
|
|
|
3
|
${ $ar->[2] } |
40
|
|
|
|
|
|
|
); |
41
|
|
|
|
|
|
|
}; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub Tie::LazyFunction::3::FETCH{ |
44
|
0
|
|
|
0
|
|
0
|
my $ar = shift; |
45
|
0
|
|
|
|
|
0
|
&{$ar->[0]}( |
|
0
|
|
|
|
|
0
|
|
46
|
0
|
|
|
|
|
0
|
${ $ar->[1] } , |
47
|
0
|
|
|
|
|
0
|
${ $ar->[2] } , |
48
|
0
|
|
|
|
|
0
|
${ $ar->[3] } |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
}; |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
sub Tie::LazyFunction::4::FETCH{ |
53
|
0
|
|
|
0
|
|
0
|
my $ar = shift; |
54
|
0
|
|
|
|
|
0
|
&{$ar->[0]}( |
|
0
|
|
|
|
|
0
|
|
55
|
0
|
|
|
|
|
0
|
${ $ar->[1] } , |
56
|
0
|
|
|
|
|
0
|
${ $ar->[2] } , |
57
|
0
|
|
|
|
|
0
|
${ $ar->[3] } , |
58
|
0
|
|
|
|
|
0
|
${ $ar->[4] } |
59
|
|
|
|
|
|
|
); |
60
|
|
|
|
|
|
|
}; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub Tie::LazyFunction::5::FETCH{ |
63
|
0
|
|
|
0
|
|
0
|
my $ar = shift; |
64
|
0
|
|
|
|
|
0
|
&{$ar->[0]}( |
|
0
|
|
|
|
|
0
|
|
65
|
0
|
|
|
|
|
0
|
${ $ar->[1] } , |
66
|
0
|
|
|
|
|
0
|
${ $ar->[2] } , |
67
|
0
|
|
|
|
|
0
|
${ $ar->[3] } , |
68
|
0
|
|
|
|
|
0
|
${ $ar->[4] } , |
69
|
0
|
|
|
|
|
0
|
${ $ar->[5] } |
70
|
|
|
|
|
|
|
); |
71
|
|
|
|
|
|
|
}; |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
sub Tie::LazyFunction::6::FETCH{ |
74
|
0
|
|
|
0
|
|
0
|
my $ar = shift; |
75
|
0
|
|
|
|
|
0
|
&{$ar->[0]}( |
|
0
|
|
|
|
|
0
|
|
76
|
0
|
|
|
|
|
0
|
${ $ar->[1] } , |
77
|
0
|
|
|
|
|
0
|
${ $ar->[2] } , |
78
|
0
|
|
|
|
|
0
|
${ $ar->[3] } , |
79
|
0
|
|
|
|
|
0
|
${ $ar->[4] } , |
80
|
0
|
|
|
|
|
0
|
${ $ar->[5] } , |
81
|
0
|
|
|
|
|
0
|
${ $ar->[6] } |
82
|
|
|
|
|
|
|
); |
83
|
|
|
|
|
|
|
}; |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub Tie::LazyFunction::n::FETCH{ |
86
|
2
|
|
|
2
|
|
60
|
my $ar = shift; |
87
|
0
|
|
|
|
|
0
|
&{$ar->[0]}( |
|
2
|
|
|
|
|
8
|
|
88
|
2
|
|
|
|
|
3
|
map { ${ $ar->[$_] }} ( 1 .. $#{$ar} ) |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
11
|
|
89
|
|
|
|
|
|
|
); |
90
|
|
|
|
|
|
|
}; |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
__END__ |