[Catalyst] html-widget bug or design?

Garrett, Philip (MAN-Corporate) Philip.Garrett at manheim.com
Wed Mar 1 20:08:31 CET 2006


-----Original Message-----
From: catalyst-bounces at lists.rawmode.org
[mailto:catalyst-bounces at lists.rawmode.org] On Behalf Of Nilson Santos
Figueiredo Junior
Sent: Wednesday, March 01, 2006 1:15 PM
To: The elegant MVC web framework
Subject: Re: [Catalyst] html-widget bug or design?

> On 3/1/06, A. Pagaltzis <pagaltzis at gmx.de> wrote:
> > Please don't. Every time I have to use such an API it makes me cry. 
> > :-( Making the type of the return value dependent on its value is a 
> > breathtaking pain in the rear end. It causes code that's gunked up 
> > with gobs of `ref $foo eq 'ARRAY'` checks.
> 
> I'm not sure when you'd need to actually check anything like that.

> * Carl Franks <fireartist at gmail.com> [2006-03-01 13:45]:
> > If there's only one by that name, return it. If there's more that
> > one, return a list in array context, an array-ref in scalar context.
> 
> If you want an array ref call it like:
> 
> my $result = Class->method;

Are you sure it's an arrayref?  What about the "if there's only one by
that
name, return it" rule?

Philip



More information about the Catalyst mailing list