[Catalyst] Re: looping

Jason Kohles email at jasonkohles.com
Wed Feb 14 19:06:24 GMT 2007


On Feb 14, 2007, at 12:21 PM, A. Pagaltzis wrote:

> Hi Ian,
>
> * Ian Docherty <catalyst at iandocherty.com> [2007-02-14 16:40]:
>> A. Pagaltzis wrote:
>>> * Will Smith <willbelair at yahoo.com> [2007-02-12 21:25]:
>>>
>>>> my $column =3D $c->model("myDB::Author")->get_column('last_name');
>>>> while(my $name =3D $column->next){
>>>>    $lname[$i] =3D $name;
>>>>    $i =3D $i + 1;
>>>> }
>>>>
>>>
>>> Ugh. Use `push`; this isn=92t C.
>>
>> Or 'map'
>
> That won=92t work here, since there=92s no list to process, just an
> iterator. (I always thought List::Util should supply `unfold`=85)
>

Of course map, push, and everything else is kind of pointless anyway...

my @name =3D $c->model( 'myDB::Author' )->get_column( 'last_name' )->all;

-- =

Jason Kohles
email at jasonkohles.com
http://www.jasonkohles.com/
"A witty saying proves nothing."  -- Voltaire


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070214/623f6=
42c/attachment.htm


More information about the Catalyst mailing list