line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package WebService::GData; |
2
|
52
|
|
|
52
|
|
78843
|
use 5.008008; |
|
52
|
|
|
|
|
267
|
|
|
52
|
|
|
|
|
4743
|
|
3
|
52
|
|
|
52
|
|
301
|
use strict; |
|
52
|
|
|
|
|
93
|
|
|
52
|
|
|
|
|
2241
|
|
4
|
52
|
|
|
52
|
|
410
|
use warnings; |
|
52
|
|
|
|
|
177
|
|
|
52
|
|
|
|
|
1879
|
|
5
|
52
|
|
|
52
|
|
315
|
use Carp; |
|
52
|
|
|
|
|
91
|
|
|
52
|
|
|
|
|
6145
|
|
6
|
52
|
|
|
52
|
|
129164
|
use overload '""' => "__to_string", '==' => 'equal', fallback => 1; |
|
52
|
|
|
|
|
77576
|
|
|
52
|
|
|
|
|
927
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = 0.06; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $AUTOLOAD; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub import { |
13
|
734
|
|
|
734
|
|
14286
|
strict->import; |
14
|
734
|
|
|
|
|
7654
|
warnings->import; |
15
|
734
|
|
|
|
|
1289
|
my $import = shift; |
16
|
734
|
|
|
|
|
1296
|
my $package = caller; |
17
|
734
|
50
|
|
|
|
1912
|
if ($import) { |
18
|
734
|
|
|
682
|
|
12741
|
install_in_package( ['private'], sub { return \&private; }, $package ); |
|
682
|
|
|
|
|
1427
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new { |
23
|
306
|
|
|
306
|
1
|
4187
|
my $package = shift; |
24
|
306
|
|
|
|
|
697
|
my $this = {}; |
25
|
306
|
|
|
|
|
809
|
bless $this, $package; |
26
|
306
|
|
|
|
|
1798
|
$this->__init(@_); |
27
|
304
|
|
|
|
|
1858
|
return $this; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub __init { |
31
|
168
|
|
|
168
|
|
459
|
my ( $this, %params ) = @_; |
32
|
|
|
|
|
|
|
|
33
|
168
|
|
|
|
|
629
|
while ( my ( $prop, $val ) = each %params ) { |
34
|
278
|
|
|
|
|
2748
|
$this->{$prop} = $val; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub __to_string { |
39
|
447
|
|
|
447
|
|
2265
|
return shift; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub equal { |
43
|
208
|
|
|
208
|
1
|
1982
|
my ( $left, $right ) = @_; |
44
|
208
|
|
|
|
|
612
|
return overload::StrVal($left) eq overload::StrVal($right); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub install_in_package { |
48
|
1409
|
|
|
1409
|
1
|
5618
|
my ( $subnames, $callback, $package ) = @_; |
49
|
|
|
|
|
|
|
|
50
|
1409
|
|
66
|
|
|
3208
|
$package = $package || caller; |
51
|
1409
|
100
|
|
|
|
66047
|
return if ( $package eq 'main' ); #never import into main |
52
|
|
|
|
|
|
|
{ #install |
53
|
52
|
|
|
52
|
|
28864
|
no strict 'refs'; |
|
52
|
|
|
|
|
123
|
|
|
52
|
|
|
|
|
2768
|
|
|
1357
|
|
|
|
|
1692
|
|
54
|
52
|
|
|
52
|
|
417
|
no warnings 'redefine'; |
|
52
|
|
|
|
|
103
|
|
|
52
|
|
|
|
|
33016
|
|
55
|
1357
|
|
|
|
|
2450
|
foreach my $sub (@$subnames) { |
56
|
1592
|
|
|
|
|
3592
|
*{ $package . '::' . $sub } = &$callback($sub); |
|
1592
|
|
|
|
|
40143
|
|
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub private { |
63
|
216
|
|
|
216
|
1
|
492
|
my ( $name, $sub ) = @_; |
64
|
216
|
|
|
|
|
429
|
my $package = caller; |
65
|
|
|
|
|
|
|
install_in_package( |
66
|
|
|
|
|
|
|
[$name], |
67
|
|
|
|
|
|
|
sub { |
68
|
|
|
|
|
|
|
return sub { |
69
|
451
|
|
|
453
|
|
5356
|
my @args = @_; |
70
|
451
|
|
|
|
|
749
|
my $p = caller; |
71
|
451
|
100
|
|
|
|
1695
|
croak { |
72
|
|
|
|
|
|
|
code => 'forbidden_access', |
73
|
|
|
|
|
|
|
content => 'private method called outside of its package' |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
if ( $p ne $package ); |
76
|
450
|
|
|
|
|
1273
|
return &$sub(@args); |
77
|
|
|
|
|
|
|
} |
78
|
216
|
|
|
216
|
|
1020
|
}, |
79
|
216
|
|
|
|
|
1095
|
$package |
80
|
|
|
|
|
|
|
); |
81
|
|
|
|
|
|
|
} |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub disable { |
84
|
5
|
|
|
5
|
1
|
15
|
my ( $parameters, $package ) = @_; |
85
|
5
|
|
66
|
|
|
34
|
$package = $package || caller; |
86
|
|
|
|
|
|
|
install_in_package( |
87
|
|
|
|
|
|
|
$parameters, |
88
|
|
|
|
|
|
|
sub { |
89
|
|
|
|
|
|
|
return sub { |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
#keep the chaining |
92
|
2
|
|
|
|
|
1034
|
return shift(); |
93
|
|
|
|
|
|
|
} |
94
|
17
|
|
|
17
|
|
53
|
}, |
95
|
5
|
|
|
|
|
47
|
$package |
96
|
|
|
|
|
|
|
); |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
} |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
##must test for side effects. |
101
|
|
|
|
|
|
|
##Might get rid of the following... |
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
sub AUTOLOAD { |
104
|
307
|
|
|
307
|
|
7154
|
my $func = $AUTOLOAD; |
105
|
|
|
|
|
|
|
|
106
|
307
|
|
|
|
|
1551
|
$func =~ s/.*:://; |
107
|
307
|
|
|
|
|
583
|
my $this = shift; |
108
|
|
|
|
|
|
|
|
109
|
307
|
50
|
|
|
|
895
|
return if $func =~ m/[A-Z]+/; |
110
|
|
|
|
|
|
|
|
111
|
307
|
100
|
|
|
|
963
|
return $this->__set( $func, @_ ) if @_ >= 1; |
112
|
|
|
|
|
|
|
|
113
|
247
|
|
|
|
|
1040
|
$this->__get($func); |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
} |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
sub __set { |
118
|
3
|
|
|
3
|
|
6
|
my ( $this, $func, @args ) = @_; |
119
|
3
|
100
|
|
|
|
9
|
$this->{$func} = @args == 1 ? $args[0] : \@args; |
120
|
3
|
|
|
|
|
16
|
return $this; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub __get { |
124
|
1
|
|
|
1
|
|
2
|
my ( $this, $func ) = @_; |
125
|
1
|
|
|
|
|
5
|
return $this->{$func}; |
126
|
|
|
|
|
|
|
} |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
"The earth is blue like an orange."; |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
__END__ |