| 1 | package HTML::Form::TextInput; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 11 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 11 | ▶ | use parent 'HTML::Form::Input'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 11 | our $VERSION = '6.13'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | # ABSTRACT: An HTML form text input element for use with HTML::Form | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | #input/text | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | #input/password | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | #input/hidden | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | #textarea | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 116 | ▶ | sub value { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
value: called CC=10 SCAR=23.0
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | 116 | my $self = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 116 | my $old = $self->{value}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | 116 | ▶ | $old = "" unless defined $old; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 116 | ▶ | if (@_) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | Carp::croak("Input '$self->{name}' is readonly") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 24 | ▶ | if $self->{strict} && $self->{readonly}; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%3/3
$self->{"strict"} and $self->{"readonly"}
MC/DC100%2/2
$self->{"strict"} and $self->{"readonly"}
$self->{"strict"}
$self->{"readonly"}
Truth table100%3/3
A and B
A= $self->{"strict"}B= $self->{"readonly"}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 22 | my $new = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 22 | ▶ | my $n = exists $self->{maxlength} ? $self->{maxlength} : undef; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | Carp::croak("Input '$self->{name}' has maxlength '$n'") | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | if $self->{strict} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 22 | ▶ | && defined($n) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
$self->{"strict"} and defined $n and defined $new and length $new > $n
$self->{"strict"} and defined $n and defined $new
$self->{"strict"} and defined $n
MC/DC75%3/4
$self->{"strict"} and defined $n and defined $new and length $new > $n
$self->{"strict"}
defined $n
defined $new
length $new > $n
Truth table80%4/5
A and B and C and D
A= $self->{"strict"}B= defined $nC= defined $newD= length $new > $n
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | && defined($new) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | && length($new) > $n; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | 21 | $self->{value} = $new; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 113 | $old; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 11 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||