On 12/17/2007 05:27 PM, A. Pagaltzis wrote:

> The sane thing is to have *TWO* methods, one that *always*
> returns a scalar, and one that *always* returns a list. (Or
> rather, an arrayref, because if it’s just a list, it is easy to
> improperly treat it like a scalar, whereas if it’s an arrayref
> it’s impossible to forget to unpack the array when you meant to
> do that.)
> 

I did something similar in my last $job, where I just had a begin() block in my 
Root.pm
that reset params->{foo} to always return an arrayref.

-- 
Peter Karman  .  [EMAIL PROTECTED]  .  http://peknet.com/


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[EMAIL PROTECTED]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to