[Catalyst-dev] Re: jshirley/jrockway

J. Shirley jshirley at gmail.com
Mon Jul 30 00:01:52 GMT 2007


On 7/29/07, Matt S Trout <dbix-class at trout.me.uk> wrote:
> On Sat, Jul 28, 2007 at 06:29:56PM -0500, Jonathan T. Rockway wrote:
> > > Because Email::Send does not take an Array of HashRefs it just takes
> > > an Array. And this is a wrapper around Email::Send and pod and code
> > > says these are ->{mailer_args}
> >
> > Good catch... but what you really want is:
> >
> >      # mailer_args is passed directly into Email::Send
> >      mailer_args:
> >          Host:       smtp.example.com
> >          username:   username
> >          password:   password
> >
> > That's both readable and flattens to:
> >
> >     - Host
> >     - smtp.example.com
> >     - ...
> >
> > V::Email needs to flatten the hashref that YAML gives it:
> >
> >     my $hashref = $config->{mailer_args};
> >     whatever_func(%$hashref);
> >
> > But it would need to do that with your config syntax too:
> >
> >     my $arrayref = $config->{mailer_args};
> >     whatever_func(@$array_ref); # same as above except for pair ordering
> >
> > I think the hashref-based method is much cleaner than your proposed
> > solution.  Any thoughts, jshirley?
>
> I think V::Email should flatten an arrayref -or- hashref but that the
> hashref example is much clearer and more likely to be what people are likely
> to use - arrayref support should be mentioned but the example need not be
> headline or, indeed, necessarily present at all.
>
> --
>       Matt S Trout       Need help with your Catalyst or DBIx::Class project?
>    Technical Director    Want a managed development or deployment platform?
>  Shadowcat Systems Ltd.  Contact mst (at) shadowcatsystems.co.uk for a quote
> http://chainsawblues.vox.com/             http://www.shadowcatsystems.co.uk/
>
> _______________________________________________
> Catalyst-dev mailing list
> Catalyst-dev at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst-dev
>

The patch I started working up does just that.  The hashref syntax is
clean and sane, and should be what is documented.

I'll be pushing 0.05 soon w/ tests and support for Mason and Template::Declare.

-J

-- 
J. Shirley :: jshirley at gmail.com :: Killing two stones with one bird...
http://www.toeat.com



More information about the Catalyst-dev mailing list