X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FTypeConstraint.pm;h=fb7047bf33f023c389a8981022aac16d3aa42e9d;hp=1e19143e55c4c5c6527dddc1cda4c14069089cbb;hb=346a3ab8a10ac61eae8021ccfd068d80ccccd56a;hpb=6e168432fa69bbe87ff0dd12e355a8b5d99a1a9c diff --git a/lib/Mouse/Meta/TypeConstraint.pm b/lib/Mouse/Meta/TypeConstraint.pm index 1e19143..fb7047b 100644 --- a/lib/Mouse/Meta/TypeConstraint.pm +++ b/lib/Mouse/Meta/TypeConstraint.pm @@ -26,7 +26,7 @@ sub new { if($args{_compiled_type_constraint}){ Carp::cluck("'_compiled_type_constraint' has been deprecated, use 'optimized' instead") - if _MOUSE_VERBOSE; + if Mouse::Util::_MOUSE_VERBOSE; $check = $args{_compiled_type_constraint}; } @@ -114,15 +114,15 @@ sub _add_type_coercions{ } else{ $self->{_compiled_type_coercion} = sub { - my($thing) = @_; - foreach my $pair (@{$coercions}) { - #my ($constraint, $converter) = @$pair; - if ($pair->[0]->check($thing)) { + my($thing) = @_; + foreach my $pair (@{$coercions}) { + #my ($constraint, $converter) = @$pair; + if ($pair->[0]->check($thing)) { local $_ = $thing; return $pair->[1]->($thing); - } - } - return $thing; + } + } + return $thing; }; } return; @@ -210,7 +210,7 @@ Mouse::Meta::TypeConstraint - The Mouse Type Constraint metaclass =head1 VERSION -This document describes Mouse version 0.40_05 +This document describes Mouse version 0.4501 =head1 DESCRIPTION