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