my $count = int(($#$array + $resultsPerPage - 2) / $resultsPerPage );