From: Jesse Luehrs Date: Sat, 7 May 2011 07:12:34 +0000 (-0500) Subject: talking about things as "magical" isn't helpful X-Git-Tag: 2.0100~133 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=de51f1923eaf51531a30642e23d3a7100dd7a408;p=gitmo%2FMoose.git talking about things as "magical" isn't helpful --- diff --git a/lib/Moose/Cookbook/Basics/Recipe5.pod b/lib/Moose/Cookbook/Basics/Recipe5.pod index d381182..c8f457c 100644 --- a/lib/Moose/Cookbook/Basics/Recipe5.pod +++ b/lib/Moose/Cookbook/Basics/Recipe5.pod @@ -67,9 +67,9 @@ C sugar function. Coercions are attached to existing type constraints, and define a (one-way) transformation from one type to another. -This is very powerful, but it's also magical, so you have to -explicitly ask for an attribute to be coerced. To do this, you must -set the C attribute option to a true value. +This is very powerful, but it can also have unexpected consequences, so +you have to explicitly ask for an attribute to be coerced. To do this, +you must set the C attribute option to a true value. First, we create the subtype to which we will coerce the other types: @@ -185,7 +185,7 @@ attributes. =head1 CONCLUSION This recipe showed the use of coercions to create a more flexible and -DWIM-y API. Like any powerful magic, we recommend some +DWIM-y API. Like any powerful feature, we recommend some caution. Sometimes it's better to reject a value than just guess at how to DWIM.