OK, so it looked at first as though Data::Pageset would be what I wanted (thanks davorg and Ranguard!), and then it looked like it didn't quite give me what I needed...
The problem seemed to stem from a design decision in Data::Pageset - it was designed for explicitly paging through sets of data (via buttons to "page up" and "page down"), rather than what I wanted which was to do the paging a-la google, where it moves to the next pageset when you click on the last page in the list. i.e. in the below, clicking on 5 should move you to a set showing pages 5..10:
<Whereas clicking on Prev/Next should take you to the next page, rather than the next pageset. This makes page flipping really easy (just hover the mouse over the "Next" button) and sensible.>
if (my $n = $page->previous_page) {
$n
<<
}
if (my $n = $page->previous_set) {
$n + $page->pages_per_set - 1
$n + $page->pages_per_set - 1
}
foreach my $n ( @{ $page->pages_in_set } ) {
$n == $page->current_page
$n
$n
}
if (my $n = $page->next_set) {
$n
$n
}
if (my $n = $page->next_page) {
$n
>>
}
Now I'm going away to patch AxKit so that I can get rid of those HORRIBLE <xsp:attribute> tags - supporting attribute value templates a-la XSLT will make this significantly cleaner.