line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FormValidator::Lite::Hash; |
2
|
30
|
|
|
30
|
|
128
|
use strict; |
|
30
|
|
|
|
|
40
|
|
|
30
|
|
|
|
|
982
|
|
3
|
30
|
|
|
30
|
|
129
|
use warnings; |
|
30
|
|
|
|
|
43
|
|
|
30
|
|
|
|
|
668
|
|
4
|
30
|
|
|
30
|
|
9063
|
use utf8; |
|
30
|
|
|
|
|
170
|
|
|
30
|
|
|
|
|
159
|
|
5
|
30
|
|
|
30
|
|
747
|
use Carp (); |
|
30
|
|
|
|
|
48
|
|
|
30
|
|
|
|
|
5764
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
6
|
|
|
6
|
0
|
52
|
my $class = shift; |
9
|
6
|
100
|
|
|
|
21
|
my @args = @_==1 ? %{$_[0]} : @_; |
|
3
|
|
|
|
|
12
|
|
10
|
6
|
|
|
|
|
19
|
my $self = bless {}, $class; |
11
|
|
|
|
|
|
|
# for Hash::MultiValue hash |
12
|
6
|
|
|
|
|
38
|
while (my ($k, $v) = splice @args, 0, 2) { |
13
|
9
|
|
|
|
|
9
|
push @{$self->{$k}}, $v; |
|
9
|
|
|
|
|
41
|
|
14
|
|
|
|
|
|
|
} |
15
|
6
|
|
|
|
|
16
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub param { |
19
|
12
|
|
|
12
|
0
|
32
|
my $self = shift; |
20
|
12
|
50
|
|
|
|
24
|
if (@_==1) { |
|
|
0
|
|
|
|
|
|
21
|
12
|
100
|
|
|
|
19
|
if (wantarray) { |
22
|
6
|
|
|
|
|
8
|
return @{$self->{$_[0]}}; |
|
6
|
|
|
|
|
31
|
|
23
|
|
|
|
|
|
|
} else { |
24
|
6
|
|
|
|
|
33
|
return $self->{$_[0]}->[0]; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} elsif (@_==0) { |
27
|
0
|
|
|
|
|
|
return keys %$self; |
28
|
|
|
|
|
|
|
} else { |
29
|
0
|
|
|
|
|
|
Carp::croak("Too much arguments for FormValidator::Lite::Hash#param: " . 0+@_); |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
0
|
0
|
|
sub upload { undef } |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |