. " and cannot be created again in "
. $pkg_defined_in )
if defined $type;
+
+ $name =~ /^[\w:\.]+$/
+ or die qq{$name contains invalid characters for a type name.}
+ . qq{Names can contain alphanumeric character, ":", and "."\n};
}
my %opts = (
use re "eval";
- my $valid_chars = qr{[\w:]};
+ my $valid_chars = qr{[\w:\.]};
my $type_atom = qr{ $valid_chars+ };
my $any;
=head2 Type Constraint Naming
+Type name declared via this module can only contain alphanumeric
+characters, colons (:), and periods (.).
+
Since the types created by this module are global, it is suggested
that you namespace your types just as you would namespace your
modules. So instead of creating a I<Color> type for your B<My::Graphics>