From the
HTML::Pager docs:
get_data_callback - this is a callback that you provide to get the pages of data. It is passed two arguements - the offset and the number of
rows in the page. You return an array ref containing array refs of row data. For you DBI-heads, this is very similar to selectall_arrayref() -
so similar that for very simple cases you can just pass the result through.
In addition to the problem described by
perl_lover above, your
get_data_callback ignores the paging variables (offset and row count).
Since you are using MySQL, you should be able to use the
LIMIT modifier to your select statement to handle paging:
my $get_data_sub= sub {
my ( $offset, $rows ) = @_;
# ...
my $stmtHandle = $dbHandle->prepare(<<" END");
SELECT sno, name, age, deptno
FROM sample1
LIMIT $offset, $rows
END
# rest of code as before