[Catalyst] Re: looping

Mark Zealey mark at itsolve.co.uk
Wed Feb 14 18:12:54 GMT 2007


You could of course do somethnig like:

push @lname => $c->model('myDB::Author')->get_column('last_name')->all;

tmtowtdi

Mark

On Wednesday 14 February 2007 5: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 = $c->model("myDB::Author")->get_column('last_name');
> >>>while(my $name = $column->next){
> >>>    $lname[$i] = $name;
> >>>    $i = $i + 1;
> >>>}
> >>
> >>Ugh. Use `push`; this isn’t C.
> >
> > Or 'map'
>
> That won’t work here, since there’s no list to process, just an
> iterator. (I always thought List::Util should supply `unfold`…)
>
> Regards,



More information about the Catalyst mailing list