line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Util::Accessor; |
2
|
116
|
|
|
116
|
|
748
|
use strict; |
|
116
|
|
|
|
|
237
|
|
|
116
|
|
|
|
|
3527
|
|
3
|
116
|
|
|
116
|
|
589
|
use warnings; |
|
116
|
|
|
|
|
250
|
|
|
116
|
|
|
|
|
10429
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub import { |
6
|
229
|
|
|
229
|
|
524
|
shift; |
7
|
229
|
50
|
|
|
|
889
|
return unless @_; |
8
|
229
|
|
|
|
|
632
|
my $package = caller(); |
9
|
229
|
|
|
|
|
654
|
mk_accessors( $package, @_ ); |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub mk_accessors { |
13
|
229
|
|
|
229
|
0
|
464
|
my $package = shift; |
14
|
116
|
|
|
116
|
|
918
|
no strict 'refs'; |
|
116
|
|
|
|
|
206
|
|
|
116
|
|
|
|
|
18167
|
|
15
|
229
|
|
|
|
|
539
|
foreach my $field ( @_ ) { |
16
|
388
|
|
|
|
|
30054
|
*{ $package . '::' . $field } = sub { |
17
|
1709
|
100
|
|
1709
|
|
33126
|
return $_[0]->{ $field } if scalar( @_ ) == 1; |
18
|
92
|
50
|
|
|
|
490
|
return $_[0]->{ $field } = scalar( @_ ) == 2 ? $_[1] : [ @_[1..$#_] ]; |
19
|
388
|
|
|
|
|
1642
|
}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |