From: Dave Rolsky Date: Thu, 4 Dec 2008 15:54:16 +0000 (+0000) Subject: Quote subtype names here X-Git-Tag: 0.62_02~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=0b3811a6c794074c6e50f4adebeab171eaa74eb3;p=gitmo%2FMoose.git Quote subtype names here --- diff --git a/lib/Moose/Cookbook/Basics/Recipe4.pod b/lib/Moose/Cookbook/Basics/Recipe4.pod index 1eafda9..19c0ea9 100644 --- a/lib/Moose/Cookbook/Basics/Recipe4.pod +++ b/lib/Moose/Cookbook/Basics/Recipe4.pod @@ -15,14 +15,14 @@ Moose::Cookbook::Basics::Recipe4 - Subtypes, and modeling a simple B cl use Regexp::Common 'zip'; my $STATES = Locale::US->new; - subtype USState + subtype 'USState' => as Str => where { ( exists $STATES->{code2state}{ uc($_) } || exists $STATES->{state2code}{ uc($_) } ); }; - subtype USZipCode + subtype 'USZipCode' => as Value => where { /^$RE{zip}{US}{-extended => 'allow'}$/; @@ -109,7 +109,7 @@ names and their two letter state codes. It is a very simple and very useful module, and perfect for use in a C constraint. my $STATES = Locale::US->new; - subtype USState + subtype 'USState' => as Str => where { ( exists $STATES->{code2state}{ uc($_) } @@ -136,7 +136,7 @@ state codes to be stored in the C slot. The next C does pretty much the same thing using the L module, and is used as the constraint for the C slot. - subtype USZipCode + subtype 'USZipCode' => as Value => where { /^$RE{zip}{US}{-extended => 'allow'}$/;