[Catalyst] looping
Will Smith
willbelair at yahoo.com
Mon Feb 12 20:31:35 GMT 2007
you're right. The $recordset is just an arrayref, that's why the ->next does not work. That's why I would like to ask, what will work in this case?
the [] brackets are for another things - I need to assign each value of the recordset to another set of arrays....
thanks
Jonathan Rockway <jon at jrock.us> wrote: Will Smith writes:
> my $recordset = [$c->model('myDB::Books')->search( authorid =>
> "${authorid}" )];
> while(my $name = $recordset->next){
> $lname[$i] = $name->lname;
> $fname[$i] = $name->fname;
> $i = $i + 1;
> }
Wrong list, but here's a hint... arrays aren't iterators. Get rid of
the []s.
--
package JAPH;use Catalyst qw/-Debug/;($;=JAPH)->config(name => do {
$,.=reverse qw[Jonathan tsu rehton lre rekca Rockway][$_].[split //,
";$;"]->[$_].q; ;for 1..4;$,=~s;^.;;;$,});$;->setup;
_______________________________________________
List: Catalyst at lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/
---------------------------------
Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070212/0816a148/attachment.htm
More information about the Catalyst
mailing list