* On Tue, Feb 12 2008, edwrb . wrote:
> Thanks Matt.  That 'as' trick took care of the SQL parsing issue.
>
> On a related note, is there a best practice for iterating through the
> result-set from these
> custom resource files by chance?  I thought something like the following would
> work:
>
>   my $rs = [ $schema->resultset( 'MainRecordQuery' )->search( {},
>     {
>       bind  => [ $category, 'Y', 'thumbnail', 'main']
>     }
>   ) ];
>
> while (my $data = $rs->next) {
>
>     print $data->thumbnail . "\n";
> }
>
> but it fails with the following error:
>
> 'Can't call method "next" on unblessed reference'  (from the while loop)

Well yeah, you've made $rs an array.  Omit the square brackets if you
want a resultset instead of a reference to a list of row objects.

Regards,
Jonathan Rockway

_______________________________________________
List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/
Searchable Archive: http://www.grokbase.com/group/[EMAIL PROTECTED]

Reply via email to