/usr/share/perl5/MooseX/Meta/TypeCoercion/Structured/Optional.pm is in libmoosex-types-structured-perl 0.30-1.
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 | package ## Hide from PAUSE
MooseX::Meta::TypeCoercion::Structured::Optional;
use Moose;
extends 'Moose::Meta::TypeCoercion';
sub compile_type_coercion {
my ($self) = @_;
my $constraint = $self->type_constraint->type_parameter;
$self->_compiled_type_coercion(sub {
my ($value) = @_;
return unless $constraint->has_coercion;
return $constraint->coerce($value);
});
}
sub has_coercion_for_type { 0 }
sub add_type_coercions {
Moose->throw_error("Cannot add additional type coercions to Optional types");
}
__PACKAGE__->meta->make_immutable(inline_constructor => 0);
1;
|