in reply to Re: Understanding how to *use* a CPAN module
in thread Understanding how to *use* a CPAN module

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

Replies are listed 'Best First'.
Re^3: Understanding how to *use* a CPAN module
by Your Mother (Archbishop) on Apr 22, 2008 at 19:28 UTC