[libtype-tiny-perl] 03/27: fix Enum regexps

Jonas Smedegaard js at alioth.debian.org
Fri Aug 9 21:13:09 UTC 2013


This is an automated email from the git hooks/post-receive script.

js pushed a commit to branch master
in repository libtype-tiny-perl.

commit 9a8b5871c96d67f611ecc9542d5264ae8aa2159f
Author: Toby Inkster <mail at tobyinkster.co.uk>
Date:   Tue Jul 30 10:30:10 2013 +0100

    fix Enum regexps
---
 lib/Type/Tiny/Enum.pm |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/Type/Tiny/Enum.pm b/lib/Type/Tiny/Enum.pm
index 39ac5ef..e412e66 100644
--- a/lib/Type/Tiny/Enum.pm
+++ b/lib/Type/Tiny/Enum.pm
@@ -46,7 +46,7 @@ sub _build_constraint
 {
 	my $self = shift;
 	my $regexp = join "|", map quotemeta, @$self;
-	return sub { defined and m{^(?:$regexp)$} };
+	return sub { defined and m{\A(?:$regexp)\z} };
 }
 
 sub can_be_inlined
@@ -59,8 +59,8 @@ sub inline_check
 	my $self = shift;
 	my $regexp = join "|", map quotemeta, @$self;
 	$_[0] eq '$_'
-		? "(defined and m{^(?:$regexp)\$})"
-		: "(defined($_[0]) and $_[0] =~ m{^(?:$regexp)\$})";
+		? "(defined and m{\\A(?:$regexp)\\z})"
+		: "(defined($_[0]) and $_[0] =~ m{\\A(?:$regexp)\\z})";
 }
 
 sub _instantiate_moose_type

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libtype-tiny-perl.git



More information about the Pkg-perl-cvs-commits mailing list