From: Graham Knop Date: Wed, 4 Sep 2013 16:24:59 +0000 (-0400) Subject: correct coerce example in pod X-Git-Tag: v1.003001~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=349ea75bb916f05ad325841b500e1fd0a9d5f2e4;p=gitmo%2FMoo.git correct coerce example in pod --- diff --git a/lib/Moo.pm b/lib/Moo.pm index f5737fd..6bf3fc0 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -529,7 +529,7 @@ Takes a coderef which is meant to coerce the attribute. The basic idea is to do something like the following: coerce => sub { - $_[0] + 1 unless $_[0] % 2 + $_[0] % 2 ? $_[0] : $_[0] + 1 }, Note that L will always fire your coercion: this is to permit