route.
That said, if you really need to inherit from a non-Moose class, see
-L<Moose::Cookbook::Basics::Recipe12> for an example of how to do it,
-or take a look at L<MooseX::NonMoose> on CPAN.
+L<Moose::Cookbook::Basics::Recipe11> for an example of how to do it,
+or take a look at L<Moose::Manual::MooseX/"MooseX::NonMoose">.
=head2 Accessors
subtype Address => as 'Str';
coerce Address => from Str => via { get_address($_) };
-
+
Which is not what they intended. The Type Constraint C<Address> is too loose in this case, it is saying that all Strings are Addresses, which is obviously not the case. The solution is to provide a where clause that properly restricts the Type Constraint.
subtype Address => as Str => where { looks_like_address($_) };
Automatically names all accessors with an explicit set and implicit
get, "size" and "set_size".
+=head2 L<MooseX::NonMoose>
+
+MooseX::NonMoose allows for easily subclassing non-Moose classes with Moose,
+taking care of the annoying details connected with doing this, such as
+setting up proper inheritance from Moose::Object and installing
+(and inlining, at make_immutable time) a constructor that makes sure things
+like BUILD methods are called.
+
=head1 AUTHOR
Dave Rolsky E<lt>autarch@urth.orgE<gt>