in reply to Understanding how to *use* a CPAN module

The documentation for this set of modules is a bit spread out, but you're on the right track. Your $result is an iterator object because you did a search. If you want a single book record for a specific isbn, use the example from WebService::ISBNDB::API::Books:
my $book = WebService::ISBNDB::API->new({ api_key => $key, isbn => '0596002068' }); my $title = $book->get_title();
The code you need is all in the docs.

Replies are listed 'Best First'.
Re^2: Understanding how to *use* a CPAN module
by bradcathey (Prior) on Apr 22, 2008 at 13:22 UTC

    perrin,

    I had tried that and was getting zero results (white screen). When I moved the api_key up to the use declaration, I started working. Must be a bug.

    #!/usr/bin/perl use strict; use CGI::Carp qw(fatalsToBrowser); use Data::Dumper; use WebService::ISBNDB::API (api_key => '12341234'); use WebService::ISBNDB::API::Books; my $book = WebService::ISBNDB::API::Books->new('0596002068'); my $title = $book->get_title(); my $authors = $book->get_authors_text(); print "Content-type: text/plain\n\n"; print Dumper($title, $authors); 1;

    Returned:

    $VAR1 = 'Programming Web services with Perl'; $VAR2 = 'Randy J. Ray and Pavel Kulchenko';

    It really helped to look at the tests. Then the docs made more sense.

    —Brad
    "The important work of moving the world forward does not wait to be done by perfect men." George Eliot