line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Plack::Util::Accessor; |
2
|
116
|
|
|
116
|
|
718
|
use strict; |
|
116
|
|
|
|
|
174
|
|
|
116
|
|
|
|
|
2854
|
|
3
|
116
|
|
|
116
|
|
479
|
use warnings; |
|
116
|
|
|
|
|
162
|
|
|
116
|
|
|
|
|
8459
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub import { |
6
|
230
|
|
|
230
|
|
460
|
shift; |
7
|
230
|
50
|
|
|
|
717
|
return unless @_; |
8
|
230
|
|
|
|
|
489
|
my $package = caller(); |
9
|
230
|
|
|
|
|
565
|
mk_accessors( $package, @_ ); |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub mk_accessors { |
13
|
230
|
|
|
230
|
0
|
312
|
my $package = shift; |
14
|
116
|
|
|
116
|
|
706
|
no strict 'refs'; |
|
116
|
|
|
|
|
189
|
|
|
116
|
|
|
|
|
15676
|
|
15
|
230
|
|
|
|
|
454
|
foreach my $field ( @_ ) { |
16
|
389
|
|
|
|
|
26072
|
*{ $package . '::' . $field } = sub { |
17
|
1716
|
100
|
|
1716
|
|
27536
|
return $_[0]->{ $field } if scalar( @_ ) == 1; |
18
|
92
|
50
|
|
|
|
417
|
return $_[0]->{ $field } = scalar( @_ ) == 2 ? $_[1] : [ @_[1..$#_] ]; |
19
|
389
|
|
|
|
|
1431
|
}; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
1; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
__END__ |