line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package FormValidator::Lite::Hash; |
2
|
30
|
|
|
30
|
|
168
|
use strict; |
|
30
|
|
|
|
|
57
|
|
|
30
|
|
|
|
|
636
|
|
3
|
30
|
|
|
30
|
|
114
|
use warnings; |
|
30
|
|
|
|
|
46
|
|
|
30
|
|
|
|
|
521
|
|
4
|
30
|
|
|
30
|
|
7347
|
use utf8; |
|
30
|
|
|
|
|
195
|
|
|
30
|
|
|
|
|
162
|
|
5
|
30
|
|
|
30
|
|
551
|
use Carp (); |
|
30
|
|
|
|
|
55
|
|
|
30
|
|
|
|
|
5281
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
6
|
|
|
6
|
0
|
59
|
my $class = shift; |
9
|
6
|
100
|
|
|
|
20
|
my @args = @_==1 ? %{$_[0]} : @_; |
|
3
|
|
|
|
|
8
|
|
10
|
6
|
|
|
|
|
13
|
my $self = bless {}, $class; |
11
|
|
|
|
|
|
|
# for Hash::MultiValue hash |
12
|
6
|
|
|
|
|
26
|
while (my ($k, $v) = splice @args, 0, 2) { |
13
|
9
|
|
|
|
|
12
|
push @{$self->{$k}}, $v; |
|
9
|
|
|
|
|
34
|
|
14
|
|
|
|
|
|
|
} |
15
|
6
|
|
|
|
|
16
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub param { |
19
|
12
|
|
|
12
|
0
|
29
|
my $self = shift; |
20
|
12
|
50
|
|
|
|
23
|
if (@_==1) { |
|
|
0
|
|
|
|
|
|
21
|
12
|
100
|
|
|
|
28
|
if (wantarray) { |
22
|
6
|
|
|
|
|
7
|
return @{$self->{$_[0]}}; |
|
6
|
|
|
|
|
26
|
|
23
|
|
|
|
|
|
|
} else { |
24
|
6
|
|
|
|
|
27
|
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; |