| 1 | 403 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||||
| 3 | package HTML::FormFu::Role::FormAndBlockMethods; | ||||||||||||||||||||||||||||||||||||||||||||
| 4 | 403 | $HTML::FormFu::Role::FormAndBlockMethods::VERSION = '2.06'; | |||||||||||||||||||||||||||||||||||||||||||
| 5 | 403 | ▶ | use Moose::Role; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||
| 7 | 403 | ▶ | use HTML::FormFu::Util qw( _merge_hashes ); | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 8 | 403 | ▶ | use Carp qw( croak ); | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 9 | 403 | ▶ | use List::Util 1.33 qw( none ); | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||||||||||||||
| 11 | sub default_args { | ||||||||||||||||||||||||||||||||||||||||||||
| 12 | 2026 | ▶ | my ( $self, $defaults ) = @_; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
default_args: called CC=5 SCAR=16.1
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||
| 13 | |||||||||||||||||||||||||||||||||||||||||||||
| 14 | 2026 | ▶ | $self->{default_args} ||= {}; | ||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
$self->{"default_args"} ||= {}
MC/DC100%1/1
$self->{"default_args"} ||= {}
$self->{"default_args"}
Truth table100%2/2
A
A= $self->{"default_args"}
| |||||||||||||||||||||||||||||||||||||||||||||
| 15 | |||||||||||||||||||||||||||||||||||||||||||||
| 16 | 2026 | ▶ | if ($defaults) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||||||||||||||
| 18 | 109 | my @valid_types = qw( | |||||||||||||||||||||||||||||||||||||||||||
| 19 | elements deflators | ||||||||||||||||||||||||||||||||||||||||||||
| 20 | filters constraints | ||||||||||||||||||||||||||||||||||||||||||||
| 21 | inflators validators | ||||||||||||||||||||||||||||||||||||||||||||
| 22 | transformers output_processors | ||||||||||||||||||||||||||||||||||||||||||||
| 23 | ); | ||||||||||||||||||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||||||||||||||||||
| 25 | 109 | for my $type ( keys %$defaults ) { | |||||||||||||||||||||||||||||||||||||||||||
| 26 | croak "not a valid type for default_args: '$type'" | ||||||||||||||||||||||||||||||||||||||||||||
| 27 | 129 | ▶ | if none { $type eq $_ } @valid_types; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.2
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||||||||||||||||||
| 30 | $self->{default_args} | ||||||||||||||||||||||||||||||||||||||||||||
| 31 | 109 | = _merge_hashes( $self->{default_args}, $defaults ); | |||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||
| 34 | 2026 | return $self->{default_args}; | |||||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 36 | |||||||||||||||||||||||||||||||||||||||||||||
| 37 | sub constraints_from_dbic { | ||||||||||||||||||||||||||||||||||||||||||||
| 38 | 0 | ▶ | my ( $self, $source, $map ) = @_; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
constraints_from_dbic: not called CC=6 SCAR=37.4
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||||
| 40 | 0 | ▶ | if ( 2 == @_ && 'ARRAY' eq ref $source ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
2 == @_ and "ARRAY" eq ref $source
MC/DC0%0/2
2 == @_ and "ARRAY" eq ref $source
2 == @_
"ARRAY" eq ref $source
Truth table0%0/3
A and B
A= 2 == @_B= "ARRAY" eq ref $source
| |||||||||||||||||||||||||||||||||||||||||||||
| 41 | 0 | ( $source, $map ) = @$source; | |||||||||||||||||||||||||||||||||||||||||||
| 42 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||||||||||||||||||
| 44 | 0 | ▶ | $map ||= {}; | ||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/2
$map ||= {}
MC/DC0%0/1
$map ||= {}
$map
Truth table0%0/2
A
A= $map
| |||||||||||||||||||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||||||||||||||||||
| 46 | 0 | $source = _result_source($source); | |||||||||||||||||||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||||||||||||||||||
| 48 | 0 | for my $col ( $source->columns ) { | |||||||||||||||||||||||||||||||||||||||||||
| 49 | 0 | _add_constraints( $self, $col, $source->column_info($col) ); | |||||||||||||||||||||||||||||||||||||||||||
| 50 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||||||||||||||||||
| 52 | 0 | for my $col ( keys %$map ) { | |||||||||||||||||||||||||||||||||||||||||||
| 53 | 0 | my $source = _result_source( $map->{$col} ); | |||||||||||||||||||||||||||||||||||||||||||
| 54 | |||||||||||||||||||||||||||||||||||||||||||||
| 55 | 0 | _add_constraints( $self, $col, $source->column_info($col) ); | |||||||||||||||||||||||||||||||||||||||||||
| 56 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 57 | |||||||||||||||||||||||||||||||||||||||||||||
| 58 | 0 | return $self; | |||||||||||||||||||||||||||||||||||||||||||
| 59 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 60 | |||||||||||||||||||||||||||||||||||||||||||||
| 61 | sub _result_source { | ||||||||||||||||||||||||||||||||||||||||||||
| 62 | 0 | ▶ | my ($source) = @_; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_result_source: not called CC=2 SCAR=17.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 63 | |||||||||||||||||||||||||||||||||||||||||||||
| 64 | 0 | ▶ | if ( blessed $source ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 65 | 0 | $source = $source->result_source; | |||||||||||||||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 67 | |||||||||||||||||||||||||||||||||||||||||||||
| 68 | 0 | return $source; | |||||||||||||||||||||||||||||||||||||||||||
| 69 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 70 | |||||||||||||||||||||||||||||||||||||||||||||
| 71 | sub _add_constraints { | ||||||||||||||||||||||||||||||||||||||||||||
| 72 | 0 | ▶ | my ( $self, $col, $info ) = @_; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraints: not called CC=16 SCAR=56.1
| |||||||||||||||||||||||||||||||||||||||||||||
| 73 | |||||||||||||||||||||||||||||||||||||||||||||
| 74 | # We need to ensure we're only using this Block's children, | ||||||||||||||||||||||||||||||||||||||||||||
| 75 | # as far as 'nested_name' is concerned. | ||||||||||||||||||||||||||||||||||||||||||||
| 76 | # But we can't use get_elements() in case the fields are in sub-Blocks | ||||||||||||||||||||||||||||||||||||||||||||
| 77 | # that don't have 'nested_name' set. | ||||||||||||||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||||||||||||||
| 79 | 0 | my $parent = $self; | |||||||||||||||||||||||||||||||||||||||||||
| 80 | 0 | my @parent_names; | |||||||||||||||||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||||||||||||||||||
| 82 | 0 | ▶ | do { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 83 | 0 | my $nested_name = $parent->nested_name; | |||||||||||||||||||||||||||||||||||||||||||
| 84 | 0 | ▶ | if ( defined $nested_name && length $nested_name ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
defined $nested_name and length $nested_name
MC/DC0%0/2
defined $nested_name and length $nested_name
defined $nested_name
length $nested_name
Truth table0%0/3
A and B
A= defined $nested_nameB= length $nested_name
| |||||||||||||||||||||||||||||||||||||||||||||
| 85 | 0 | push @parent_names, $nested_name; | |||||||||||||||||||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 87 | } while ( $parent = $parent->parent ); | ||||||||||||||||||||||||||||||||||||||||||||
| 88 | |||||||||||||||||||||||||||||||||||||||||||||
| 89 | 0 | my $fields = $self->get_fields($col); | |||||||||||||||||||||||||||||||||||||||||||
| 90 | 0 | ▶ | return if !@$fields; | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 91 | |||||||||||||||||||||||||||||||||||||||||||||
| 92 | 0 | ▶ | if (@parent_names) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 93 | 0 | my $pre = join ".", reverse @parent_names; | |||||||||||||||||||||||||||||||||||||||||||
| 94 | 0 | @$fields = grep { $_->nested_name eq "$pre." . $_->name } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 95 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 96 | else { | ||||||||||||||||||||||||||||||||||||||||||||
| 97 | 0 | @$fields = grep { $_->nested_name eq $_->name } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 98 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 99 | |||||||||||||||||||||||||||||||||||||||||||||
| 100 | 0 | ▶ | return if !@$fields; | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||
| 102 | 0 | ▶ | return if !defined $info->{data_type}; | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 103 | |||||||||||||||||||||||||||||||||||||||||||||
| 104 | 0 | my $type = lc $info->{data_type}; | |||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||||
| 106 | 0 | ▶ | if ( $type =~ /(char|text|binary)\z/ && defined $info->{size} ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 5 branches
Condition0%0/3
$type =~ /(char|text|binary)\z/ and defined $info->{"size"}
MC/DC0%0/2
$type =~ /(char|text|binary)\z/ and defined $info->{"size"}
$type =~ /(char|text|binary)\z/
defined $info->{"size"}
Truth table0%0/3
A and B
A= $type =~ /(char|text|binary)\z/B= defined $info->{"size"}
| |||||||||||||||||||||||||||||||||||||||||||||
| 107 | |||||||||||||||||||||||||||||||||||||||||||||
| 108 | # char, varchar, *text, binary, varbinary | ||||||||||||||||||||||||||||||||||||||||||||
| 109 | 0 | _add_constraint_max_length( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 110 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 111 | elsif ( $type =~ /int/ ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 112 | 0 | _add_constraint_integer( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | if ( $info->{extra}{unsigned} ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 115 | 0 | _add_constraint_unsigned( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 116 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 118 | ▶ | elsif ( $type =~ /enum|set/ && defined $info->{extra}{list} ) { | |||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$type =~ /enum|set/ and defined $info->{"extra"}{"list"}
MC/DC0%0/2
$type =~ /enum|set/ and defined $info->{"extra"}{"list"}
$type =~ /enum|set/
defined $info->{"extra"}{"list"}
Truth table0%0/3
A and B
A= $type =~ /enum|set/B= defined $info->{"extra"}{"list"}
| |||||||||||||||||||||||||||||||||||||||||||||
| 119 | 0 | _add_constraint_set( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 120 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 121 | elsif ( $type =~ /bool/ ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 122 | 0 | _add_constraint_bool( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 123 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 124 | elsif ( $type =~ /decimal/ ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 125 | 0 | _add_constraint_decimal( $self, $fields, $info ); | |||||||||||||||||||||||||||||||||||||||||||
| 126 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 127 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 128 | |||||||||||||||||||||||||||||||||||||||||||||
| 129 | sub _add_constraint_max_length { | ||||||||||||||||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | my ( $self, $fields, $info ) = @_; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_max_length: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||
| 132 | 0 | map { $_->constraint( { type => 'MaxLength', max => $info->{size}, } ) } | |||||||||||||||||||||||||||||||||||||||||||
| 133 | @$fields; | ||||||||||||||||||||||||||||||||||||||||||||
| 134 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 135 | |||||||||||||||||||||||||||||||||||||||||||||
| 136 | sub _add_constraint_integer { | ||||||||||||||||||||||||||||||||||||||||||||
| 137 | 0 | ▶ | my ( $self, $fields, $info ) = @_; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_integer: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 138 | |||||||||||||||||||||||||||||||||||||||||||||
| 139 | 0 | map { $_->constraint( { type => 'Integer', } ) } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 140 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 141 | |||||||||||||||||||||||||||||||||||||||||||||
| 142 | sub _add_constraint_unsigned { | ||||||||||||||||||||||||||||||||||||||||||||
| 143 | 0 | ▶ | my ( $self, $fields, $info ) = @_; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_unsigned: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 144 | |||||||||||||||||||||||||||||||||||||||||||||
| 145 | 0 | map { $_->constraint( { type => 'Range', min => 0, } ) } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 146 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||||||||||||||
| 148 | sub _add_constraint_set { | ||||||||||||||||||||||||||||||||||||||||||||
| 149 | 0 | ▶ | my ( $self, $fields, $info ) = @_; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_set: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 150 | |||||||||||||||||||||||||||||||||||||||||||||
| 151 | 0 | map { $_->constraint( { type => 'Set', set => $info->{extra}{list}, } ) } | |||||||||||||||||||||||||||||||||||||||||||
| 152 | @$fields; | ||||||||||||||||||||||||||||||||||||||||||||
| 153 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 154 | |||||||||||||||||||||||||||||||||||||||||||||
| 155 | sub _add_constraint_bool { | ||||||||||||||||||||||||||||||||||||||||||||
| 156 | 0 | ▶ | my ( $self, $fields, $info ) = @_; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_bool: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||||
| 157 | |||||||||||||||||||||||||||||||||||||||||||||
| 158 | 0 | map { $_->constraint( { type => 'Set', set => [ 0, 1 ] } ) } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 160 | |||||||||||||||||||||||||||||||||||||||||||||
| 161 | sub _add_constraint_decimal { | ||||||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | ▶ | my ( $self, $fields, $info ) = @_; | ||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_add_constraint_decimal: not called CC=9 SCAR=45.0
| |||||||||||||||||||||||||||||||||||||||||||||
| 163 | |||||||||||||||||||||||||||||||||||||||||||||
| 164 | 0 | my $size = $info->{size}; | |||||||||||||||||||||||||||||||||||||||||||
| 165 | 0 | my $regex; | |||||||||||||||||||||||||||||||||||||||||||
| 166 | |||||||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | if ( defined $size ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||
| 168 | 0 | ▶ | if ( 'ARRAY' eq ref $size && 2 == @$size ) { | ||||||||||||||||||||||||||||||||||||||||||
|
Branch: 4 branches
Condition0%0/3
"ARRAY" eq ref $size and 2 == @$size
MC/DC0%0/2
"ARRAY" eq ref $size and 2 == @$size
"ARRAY" eq ref $size
2 == @$size
Truth table0%0/3
A and B
A= "ARRAY" eq ref $sizeB= 2 == @$size
| |||||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | my ( $i, $j ) = @$size; | |||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | $i -= $j; | |||||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | $regex = qr/^ [0-9]{0,$i} (?: \. [0-9]{0,$j} )? \z/x; | |||||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 173 | ▶ | elsif ( 'ARRAY' eq ref $size && 1 == @$size ) { | |||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
"ARRAY" eq ref $size and 1 == @$size
MC/DC0%0/2
"ARRAY" eq ref $size and 1 == @$size
"ARRAY" eq ref $size
1 == @$size
Truth table0%0/3
A and B
A= "ARRAY" eq ref $sizeB= 1 == @$size
| |||||||||||||||||||||||||||||||||||||||||||||
| 174 | 0 | my ($i) = @$size; | |||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | $regex = qr/^ [0-9]{0,$i} \z/x; | |||||||||||||||||||||||||||||||||||||||||||
| 176 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 177 | elsif ( 0 == $size ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | $regex = qr/^ [0-9]+ \z/x; | |||||||||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 180 | elsif ( $size =~ /^[0-9]+\z/ ) { | ||||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | $regex = qr/^ [0-9]{0,$size} \z/x; | |||||||||||||||||||||||||||||||||||||||||||
| 182 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 183 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 184 | |||||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | ▶ | $regex ||= qr/^ [0-9]+ (?: \. [0-9]+ )? \z/x; | ||||||||||||||||||||||||||||||||||||||||||
|
Condition0%0/3
$regex ||= qr/^ [0-9]+ (?: \. [0-9]+ )? \z/x
MC/DC0%0/2
$regex ||= qr/^ [0-9]+ (?: \. [0-9]+ )? \z/x
$regex
qr/^ [0-9]+ (?: \. [0-9]+ )? \z/x
Truth table0%0/3
A ||= B
A= $regexB= qr/^ [0-9]+ (?: \. [0-9]+ )? \z/x
| |||||||||||||||||||||||||||||||||||||||||||||
| 186 | |||||||||||||||||||||||||||||||||||||||||||||
| 187 | 0 | map { $_->constraint( { type => 'Regex', regex => $regex } ) } @$fields; | |||||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||||
| 190 | 403 | 1; | |||||||||||||||||||||||||||||||||||||||||||
| 191 | |||||||||||||||||||||||||||||||||||||||||||||
| 192 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||||
| 194 | =pod | ||||||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||||
| 196 | =encoding UTF-8 | ||||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||||
| 198 | =head1 NAME | ||||||||||||||||||||||||||||||||||||||||||||
| 199 | |||||||||||||||||||||||||||||||||||||||||||||
| 200 | HTML::FormFu::Role::FormAndBlockMethods | ||||||||||||||||||||||||||||||||||||||||||||
| 201 | |||||||||||||||||||||||||||||||||||||||||||||
| 202 | =head1 VERSION | ||||||||||||||||||||||||||||||||||||||||||||
| 203 | |||||||||||||||||||||||||||||||||||||||||||||
| 204 | version 2.06 | ||||||||||||||||||||||||||||||||||||||||||||
| 205 | |||||||||||||||||||||||||||||||||||||||||||||
| 206 | =head1 AUTHOR | ||||||||||||||||||||||||||||||||||||||||||||
| 207 | |||||||||||||||||||||||||||||||||||||||||||||
| 208 | Carl Franks <cpan@fireartist.com> | ||||||||||||||||||||||||||||||||||||||||||||
| 209 | |||||||||||||||||||||||||||||||||||||||||||||
| 210 | =head1 COPYRIGHT AND LICENSE | ||||||||||||||||||||||||||||||||||||||||||||
| 211 | |||||||||||||||||||||||||||||||||||||||||||||
| 212 | This software is copyright (c) 2018 by Carl Franks. | ||||||||||||||||||||||||||||||||||||||||||||
| 213 | |||||||||||||||||||||||||||||||||||||||||||||
| 214 | This is free software; you can redistribute it and/or modify it under | ||||||||||||||||||||||||||||||||||||||||||||
| 215 | the same terms as the Perl 5 programming language system itself. | ||||||||||||||||||||||||||||||||||||||||||||
| 216 | |||||||||||||||||||||||||||||||||||||||||||||
| 217 | =cut | ||||||||||||||||||||||||||||||||||||||||||||