[Catalyst] looping

Jonathan Rockway jon at jrock.us
Mon Feb 12 20:21:03 GMT 2007


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;



More information about the Catalyst mailing list