From: Dave Rolsky Date: Fri, 24 Oct 2008 23:50:06 +0000 (+0000) Subject: Fixed a couple doc typos X-Git-Tag: 0.01~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f9468aace9af5637205349fd1c6e1ff42b28d4d7;hp=c81443cb26d69dfd732202a51b2ad68549a829c2;p=gitmo%2FMooseX-Types-Structured.git Fixed a couple doc typos Also tweaked some example code to use DateTime a little more sanely (now - past makes more sense than the other way round) --- diff --git a/lib/MooseX/Types/Structured.pm b/lib/MooseX/Types/Structured.pm index ab543ed..98e88d1 100644 --- a/lib/MooseX/Types/Structured.pm +++ b/lib/MooseX/Types/Structured.pm @@ -96,14 +96,14 @@ method, granting some interesting possibilities for coercion. Try: }, from (Dict[last_name=>Str, first_name=>Str, dob=>DateTime]), via { - my $name = _->{first_name} .' '. $_->{last_name}; - my $age = $_->{dob} - DateTime->now; + my $name = $_->{first_name} .' '. $_->{last_name}; + my $age = DateTime->now - $_->{dob}; MyApp::MyStruct->new( name=>$name, age=>$age->years ); }; -You also need to exercise some care when you try to structure a structured type +You also need to exercise some care when you try to subtype a structured type as in this example: subtype Person,