| 1 | package HTML::FillInForm::Lite::Compat; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 2 | our $VERSION = '1.14'; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 2 | ▶ | use HTML::FillInForm::Lite; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 2 | our @ISA = qw(HTML::FillInForm::Lite); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | 2 | ▶ | $INC{'HTML/FillInForm.pm'} ||= __FILE__; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$INC{"HTML/FillInForm.pm"} ||= __FILE__
MC/DC0%0/1
$INC{"HTML/FillInForm.pm"} ||= __FILE__
$INC{"HTML/FillInForm.pm"}
Truth table50%1/2
A
A= $INC{"HTML/FillInForm.pm"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 2 | ▶ | push @HTML::FillInForm::ISA, __PACKAGE__ | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | unless HTML::FillInForm->isa(__PACKAGE__); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 2 | 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 | 2 | my %extended_keys = ( | |||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | escape => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | decode_entity => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | layer => 1, | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | 2 | @known_keys{keys %extended_keys} = (); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | BEGIN{ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 2 | ▶ | *fill_file = \&fill; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | 2 | *fill_arrayref = \&fill; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | 2 | *fill_scalarref = \&fill; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | sub new{ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 13 | ▶ | my $class = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 13 | ▶ | if(@_){ | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 1 | warnings::warnif(portable => | |||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | qq{$class->new() accepts no options, } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | . q{use HTML::FillInForm::Lite->new(...) instead}); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | 12 | return $class->SUPER::new(); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | sub fill{ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 29 | ▶ | my $self = shift; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
fill: called CC=16 SCAR=27.7
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | 29 | my $source; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | my $data; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 29 | ▶ | if (defined $_[0] and not exists $known_keys{ $_[0] }){ | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $_[0] and not exists $known_keys{$_[0]}
MC/DC100%2/2
defined $_[0] and not exists $known_keys{$_[0]}
defined $_[0]
not exists $known_keys{$_[0]}
Truth table100%3/3
A and not(B)
A= defined $_[0]B= not exists $known_keys{$_[0]}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | 15 | $source = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 29 | ▶ | if (defined $_[0] and not exists $known_keys{ $_[0] }){ | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $_[0] and not exists $known_keys{$_[0]}
MC/DC100%2/2
defined $_[0] and not exists $known_keys{$_[0]}
defined $_[0]
not exists $known_keys{$_[0]}
Truth table100%3/3
A and not(B)
A= defined $_[0]B= not exists $known_keys{$_[0]}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 10 | $data = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 29 | my %option = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 29 | foreach my $key(keys %option){ | |||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | 32 | ▶ | if(exists $extended_keys{$key}){ | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | 2 | warnings::warnif(portable => qq{HTML::FillInForm::Lite-specific option "$key" supplied}); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | 28 | ▶ | $source ||= $option{file} || $option{scalarref} || $option{arrayref}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%9/9
$source ||= $option{"file"} || $option{"scalarref"} || $option{"arrayref"}
$option{'file'} || $option{'scalarref'} || $option{'arrayref'}
$option{"file"} or $option{"scalarref"}
MC/DC0%0/4
$source ||= $option{"file"} || $option{"scalarref"} || $option{"arrayref"}
$source
$option{"file"}
$option{"scalarref"}
$option{'arrayref'}
Truth table0%0/5
A ||= B or C || D
A= $sourceB= $option{"file"}C= $option{"scalarref"}D= $option{'arrayref'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 28 | ▶ | $data ||= $option{fdat} || $option{fobject}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%6/6
$data ||= $option{"fdat"} || $option{"fobject"}
$option{'fdat'} || $option{'fobject'}
MC/DC0%0/3
$data ||= $option{"fdat"} || $option{"fobject"}
$data
$option{'fdat'}
$option{'fobject'}
Truth table0%0/4
A ||= B || C
A= $dataB= $option{'fdat'}C= $option{'fobject'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | # ensure to delete all sources and data | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | 28 | delete @option{qw(scalarref arrayref file fdat fobject)}; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | $option{fill_password} = 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | 28 | ▶ | unless defined $option{fill_password}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | $option{decode_entity} = 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | 28 | ▶ | unless defined $option{decode_entity}; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | $option{ignore_fields} = [ $option{ignore_fields} ] | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | if defined $option{ignore_fields} | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | 28 | ▶ | and ref $option{ignore_fields} ne 'ARRAY'; | ||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
defined $option{"ignore_fields"} and ref $option{"ignore_fields"} ne "ARRAY"
MC/DC100%2/2
defined $option{"ignore_fields"} and ref $option{"ignore_fields"} ne "ARRAY"
defined $option{"ignore_fields"}
ref $option{"ignore_fields"} ne "ARRAY"
Truth table100%3/3
A and B
A= defined $option{"ignore_fields"}B= ref $option{"ignore_fields"} ne "ARRAY"
| |||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 28 | return $self->SUPER::fill($source, $data, %option); | |||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | 2 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | |||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||