There are two problems: first, your line
print $book('title');
should be
print $book->{'title'};
as $book is a hashref.
More importantly, the module goes to the wrong site. It goes to lcweb.loc.gov which is now www.loc.gov. Editing the module fixes that. You should probably contact the author and let him know. His contact information is in the CPAN documentation.
Here is my (working after changing LOC_Driver) code:
use WWW::Scraper::ISBN::Driver;
use WWW::Scraper::ISBN::LOC_Driver;
$driver = WWW::Scraper::ISBN::LOC_Driver->new();
$LOC = "0764516965";
$driver->verbosity(1);
$driver->search($LOC);
die " $LOC Not Found" if ! $driver->found;
print "Here is the info on $LOC\n";
print ref $book;
my $book = $driver->book;
print $book->{title};
HTH, --traveler
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.