[Catalyst] html-widget bug or design?

A. Pagaltzis pagaltzis at gmx.de
Thu Mar 2 17:02:06 CET 2006


* Brian Kirkbride <brian.kirkbride at deeperbydesign.com> [2006-03-02 15:20]:
>Nilson Santos Figueiredo Junior wrote:
>> If you want an array ref call it like:
>> 
>> my $result = Class->method;
>> 
>> If you want a list of values call it like:
>> 
>> my ($result) = Class->method;
>
>I think that is what he was requesting, actually.  
>
>His problem was with code like this:
>
>sub method {
>  return $results[0] if scalar(@results) == 1;
>  return wantarray ? @results : \@results;
>}
>
>Which really is a pain, IMHO.

Exactly.

Some time ago I had to use a config module that worked like that.
Banging your head against the wall is more fun than such an API,
believe me. :-(

Regards,
-- 
Aristotle Pagaltzis // <http://plasmasturm.org/>



More information about the Catalyst mailing list