Subject: | response() does not stop requesting |
Net::Google::Search::response() fails to stop requesting Google if all results have been retrieved if the number of results is divisible by ten. It will only stop when max_results is reached. Google always returns the last ten results, even if the value of <start> is higher then the total number of results, hence the results are not only requested, but also erroneously added to the result set, causing a lot of duplicate results.
This can be fixed by adding
...
my $res = $self->_response($start_at,$count) || next;
last if $start_at >= $res->{__endIndex};
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
It will still request one superfluous result set, but that cannot be fixed in this package (IMHO).