Subject: | API->search and subsequent iterator usage leads to warnings and Access key error |
This script:
use 5.014;
use warnings;
use lib 'lib';
use WebService::ISBNDB::API;
my $handle = WebService::ISBNDB::API->new({
protocol => 'REST',
api_key => '<myapikey>',
});
my $books = $handle->search(Books => { isbn => '0152453008' });
while (my $book = $books->next) {
say $book->get_title;
say join ', ', $book->get_authors;
}
Leads to the following output:
Use of uninitialized value in uc at lib/WebService/ISBNDB/API.pm line 231.
Use of uninitialized value in uc at lib/WebService/ISBNDB/API.pm line 231.
Use of uninitialized value in uc at lib/WebService/ISBNDB/API.pm line 231.
Use of uninitialized value in uc at lib/WebService/ISBNDB/API.pm line 231.
The light princess
Use of uninitialized value in uc at lib/WebService/ISBNDB/API.pm line 231.
Use of uninitialized value in uc at lib/WebService/ISBNDB/API.pm line 231.
Service error: Access key error at lib/WebService/ISBNDB/Agent/REST.pm
line 226.
It seems that some code path fails to propagate the protocol and API key
to new objects.
Running t/20_publishers.t also produces lots of the same warnings.
This is on Linux and perl-5.14.0.