line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::FillInForm::Lite::Compat; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
60956
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
36
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
61
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '1.15'; |
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
539
|
use HTML::FillInForm::Lite; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
204
|
|
9
|
|
|
|
|
|
|
our @ISA = qw(HTML::FillInForm::Lite); |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
$INC{'HTML/FillInForm.pm'} ||= __FILE__; |
12
|
|
|
|
|
|
|
push @HTML::FillInForm::ISA, __PACKAGE__ |
13
|
|
|
|
|
|
|
unless HTML::FillInForm->isa(__PACKAGE__); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my %known_keys = ( |
16
|
|
|
|
|
|
|
scalarref => 1, |
17
|
|
|
|
|
|
|
arrayref => 1, |
18
|
|
|
|
|
|
|
fdat => 1, |
19
|
|
|
|
|
|
|
fobject => 1, |
20
|
|
|
|
|
|
|
file => 1, |
21
|
|
|
|
|
|
|
target => 1, |
22
|
|
|
|
|
|
|
fill_password => 1, |
23
|
|
|
|
|
|
|
ignore_fields => 1, |
24
|
|
|
|
|
|
|
disable_fields => 1, |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
my %extended_keys = ( |
28
|
|
|
|
|
|
|
escape => 1, |
29
|
|
|
|
|
|
|
decode_entity => 1, |
30
|
|
|
|
|
|
|
layer => 1, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
@known_keys{keys %extended_keys} = (); |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
BEGIN{ |
36
|
1
|
|
|
1
|
|
5
|
*fill_file = \&fill; |
37
|
1
|
|
|
|
|
2
|
*fill_arrayref = \&fill; |
38
|
1
|
|
|
|
|
358
|
*fill_scalarref = \&fill; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub new{ |
42
|
13
|
|
|
13
|
1
|
8175
|
my $class = shift; |
43
|
|
|
|
|
|
|
|
44
|
13
|
100
|
|
|
|
33
|
if(@_){ |
45
|
1
|
|
|
|
|
232
|
warnings::warnif(portable => |
46
|
|
|
|
|
|
|
qq{$class->new() accepts no options, } |
47
|
|
|
|
|
|
|
. q{use HTML::FillInForm::Lite->new(...) instead}); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
12
|
|
|
|
|
34
|
return $class->SUPER::new(); |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub fill{ |
54
|
29
|
|
|
29
|
1
|
5067
|
my $self = shift; |
55
|
|
|
|
|
|
|
|
56
|
29
|
|
|
|
|
24
|
my $source; |
57
|
|
|
|
|
|
|
my $data; |
58
|
|
|
|
|
|
|
|
59
|
29
|
100
|
100
|
|
|
123
|
if (defined $_[0] and not exists $known_keys{ $_[0] }){ |
60
|
15
|
|
|
|
|
16
|
$source = shift; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
29
|
100
|
100
|
|
|
86
|
if (defined $_[0] and not exists $known_keys{ $_[0] }){ |
64
|
10
|
|
|
|
|
8
|
$data = shift; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
29
|
|
|
|
|
43
|
my %option = @_; |
68
|
|
|
|
|
|
|
|
69
|
29
|
|
|
|
|
48
|
foreach my $key(keys %option){ |
70
|
32
|
100
|
|
|
|
52
|
if(exists $extended_keys{$key}){ |
71
|
2
|
|
|
|
|
213
|
warnings::warnif(portable => qq{HTML::FillInForm::Lite-specific option "$key" supplied}); |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
} |
74
|
|
|
|
|
|
|
|
75
|
28
|
|
66
|
|
|
84
|
$source ||= $option{file} || $option{scalarref} || $option{arrayref}; |
|
|
|
100
|
|
|
|
|
76
|
28
|
|
66
|
|
|
69
|
$data ||= $option{fdat} || $option{fobject}; |
|
|
|
100
|
|
|
|
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
# ensure to delete all sources and data |
79
|
28
|
|
|
|
|
46
|
delete @option{qw(scalarref arrayref file fdat fobject)}; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
$option{fill_password} = 1 |
82
|
28
|
100
|
|
|
|
52
|
unless defined $option{fill_password}; |
83
|
|
|
|
|
|
|
$option{decode_entity} = 1 |
84
|
28
|
100
|
|
|
|
44
|
unless defined $option{decode_entity}; |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
$option{ignore_fields} = [ $option{ignore_fields} ] |
87
|
|
|
|
|
|
|
if defined $option{ignore_fields} |
88
|
28
|
100
|
100
|
|
|
48
|
and ref $option{ignore_fields} ne 'ARRAY'; |
89
|
|
|
|
|
|
|
|
90
|
28
|
|
|
|
|
84
|
return $self->SUPER::fill($source, $data, %option); |
91
|
|
|
|
|
|
|
} |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
1; |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
__END__ |