/usr/share/perl5/HTML/Widget/Constraint/In.pm is in libhtml-widget-perl 1.11-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | package HTML::Widget::Constraint::In;
use base 'HTML::Widget::Constraint';
use strict;
use warnings;
__PACKAGE__->mk_accessors(qw/in/);
=head1 NAME
HTML::Widget::Constraint::In - Check that a value is one of a current set.
=head1 SYNOPSIS
$widget->constraint( In => "foo" )->in(qw/possible values/);
=head1 DESCRIPTION
=head1 METHODS
=head2 validate
=cut
sub validate {
my ( $self, $value ) = @_;
# Return valid on an empty value
return 1 unless defined($value);
return 1 if ( $value eq '' );
my $in = $self->in;
my %in = map { $_ => 1 } ref $in ? @{ $self->in } : $in;
return exists $in{$value};
}
=head2 in
Arguments: @values
A list of valid values for that element.
=cut
1;
|