It's best to use a pager for this sort of thing. To get your Data::Page object do this:<br>my $pager = $rs->pager;<br><br>and then to get the total page count do this:<br>my $total = $pager->total_entries;<br><br><a href="http://search.cpan.org/~mstrout/DBIx-Class-0.06000/lib/DBIx/Class/Manual/Cookbook.pod#Paged_results">
http://search.cpan.org/~mstrout/DBIx-Class-0.06000/lib/DBIx/Class/Manual/Cookbook.pod#Paged_results</a><br><a href="http://search.cpan.org/~lbrocard/Data-Page-2.00/lib/Data/Page.pm">http://search.cpan.org/~lbrocard/Data-Page-2.00/lib/Data/Page.pm
</a><br><br><div><span class="gmail_quote">On 4/10/06, <b class="gmail_sendername">Jesse Sheidlower</b> <<a href="mailto:jester@panix.com">jester@panix.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>I'm dynamically constructing my $rs search statements, and including<br>"page" and "rows" values in my attribute hash, for paged results.<br><br>In my display template, I'd like to do something like "25837
<br>records found; displaying 50-100". However, when I call<br>$rs->count() to get the count, I'm only getting the value of<br>"rows" or less; that is, I get the count of my particular page<br>of the resultset, rather than on the complete search. This
<br>despite the fact that the SQL I get from running under<br>DBIX_CLASS_STORAGE_DBI_DEBUG=1 does not specify any kind of<br>limit.<br><br>How do I get the full count from my resultset?<br><br>Jesse Sheidlower<br><br>_______________________________________________
<br>List: <a href="http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class">http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class</a><br>Wiki: <a href="http://dbix-class.shadowcatsystems.co.uk/">http://dbix-class.shadowcatsystems.co.uk/
</a><br>IRC: irc.perl.org#dbix-class<br>SVN: <a href="http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/">http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/</a><br></blockquote></div><br>