EOF
}
my $groups = int($size / $last) + 1;
$html .= " | \n | ";
for ($i = 0; $i < $groups; $i++) {
my $start = $i * $last + 1;
my $next = $start - 1;
my $end = $i * $last + $resultsPerPage;
last if ($start > $size);
if ($end > $size) {
$end = $size;
}
$html.=<$start - $end |
EOF
}
$html .= " | \n";
if ($first + $last < $size) {
my $next = $first + $resultsPerPage;
if ($next + $resultsPerPage > $size) {
$resultsPerPage -= $next + $resultsPerPage - $size;
}
$html.=<
Next $resultsPerPage Results
EOF
} else {
$html.=<
EOF
}
$html.= "