X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FTypeConstraint%2FEnum.pm;h=65b77536bf093410f92bd95af78f50cc13765a39;hb=3975b592007cd8f44368f71cedc60fba86b5a1f2;hp=b19c59b8092c9d38d7f747b419ed1ac96a755075;hpb=477a812e8edd6ee5ebee1a3b7b90cfeac3b2b9f7;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/TypeConstraint/Enum.pm b/lib/Moose/Meta/TypeConstraint/Enum.pm index b19c59b..65b7753 100644 --- a/lib/Moose/Meta/TypeConstraint/Enum.pm +++ b/lib/Moose/Meta/TypeConstraint/Enum.pm @@ -22,13 +22,10 @@ my $inliner = sub { my $name = $self->name(); $ENUMS{$name} ||= { map { $_ => 1 } @{ $self->values() } }; - return - "defined $val" - . "&& ! ref $val" . '&& $' - . __PACKAGE__ - . '::ENUMS{' - . B::perlstring($name) - . "}{ $val }"; + return 'defined(' . $val . ') ' + . '&& !ref(' . $val . ') ' + . '&& $' . __PACKAGE__ . '::ENUMS{' . B::perlstring($name) . '}' + . '{' . $val . '}'; }; sub new {