Try it like this:
my $more_magnetude = Type::Coercion->new( name => 'MoreMagnitude', type_constraint => Num, type_coercion_map => [ Str, sub { $lookup->{$_}* 11 } ], );
See the documentation of the constructor and attributes of Type::Coercion.
(If it makes you feel any better, it took me a several minutes to spot what you were going wrong.)
In reply to Re: Type::Coercion on the fly
by tobyink
in thread Type::Coercion on the fly
by jandrew
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |