p5-type-tiny
p5-type-tiny copied to clipboard
how to avoid loading class you want to coerce to?
Although not explicitly stated in Type::Tiny::Manual::Coercions Type::Tiny
based coercion requires that the class you want to coerce to is previously loaded, otherwise you get a exception like
Can't locate object method "parse" via package "Foo" (perhaps you forgot to load "Foo"?) at compiled coercion 'to_Name' line 1.
Params::Coerce
has a different philosophy Loading-Classes.
How to tell Type::Tiny
to load the class you want to coerce to at run-time?