Aaron Crane wrote:
> A. Pagaltzis writes:
>> So the right way to write that code “fancily” is thus:
>>
>> my %cb = map {
>> $_->isa( 'HTML::Widget::Element::Checkbox' )
>> ? ( $_->name => undef )
>> : ()
>> } @{ $result->{_elements} };
>
> I think this is much easier to read:
>
> my %cb = map { $_->name => undef }
> grep { $_->isa('HTML::Widget::Element::Checkbox') }
> @{ $result->{_elements} };
>
I agree, that's in a patch I sent to this list a few weeks ago.
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/