From: Dave Rolsky Date: Wed, 11 Feb 2009 19:32:13 +0000 (+0000) Subject: Make the "do not coerce class names" example match basics recipe 5 X-Git-Tag: 0.69~21 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=09ea5cd7ae0f140763ecff31cd121c1bc610064d;p=gitmo%2FMoose.git Make the "do not coerce class names" example match basics recipe 5 --- diff --git a/lib/Moose/Manual/BestPractices.pod b/lib/Moose/Manual/BestPractices.pod index 157e499..56c9709 100644 --- a/lib/Moose/Manual/BestPractices.pod +++ b/lib/Moose/Manual/BestPractices.pod @@ -169,9 +169,9 @@ have magical side effects elsewhere: Instead, we can create an "empty" subtype for the coercion: - subtype 'My.HTTP.Headers' => as class_type('HTTP::Headers'); + subtype 'My.HTTP::Headers' => as class_type('HTTP::Headers'); - coerce 'My.HTTP.Headers' + coerce 'My.HTTP::Headers' => from 'HashRef' => via { HTTP::Headers->new( %{$_} ) };