If you get lost in that maze of OOO, (I did:), you might like to try something like:

#! perl -slw use strict; use LWP::Simple; use XML::Simple; use Data::Dump qw[ pp ]; use constant ACCESS_ID => 'XXXXXXXX'; ## Your access key here. my $isbn = $ARGV[ 0 ] or die 'Need an ISBN number'; die "'$isbn' doesn't look like a valid ISBN" unless $isbn =~ m[^\d{10}$]; my $uri = sprintf "http://isbndb.com/api/books.xml?access_key=%s&index1=isbn&value1= +%s", ACCESS_ID, $isbn; my $xml = get $uri or die "Request failed"; my $info = XMLin $xml; pp $info;

A sample usage:

C:\test>isbndb 0131101633 { BookList => { BookData => { AuthorsText => "Brian W. Kernighan, Dennis M. Ritchie", PublisherText => { content => "Englewood Cliffs, N.J. : Prentice-Hall, c1978.", publisher_id => "prentice_hall_a01", }, Title => "The C programming language", TitleLong => {}, book_id => "the_c_programming_language", isbn => "0131101633", }, page_number => 1, page_size => 10, shown_results => 1, total_results => 1, }, server_time => "2008-04-22T03:13:35Z", }

Wrapping that into a module with an api like:

use ISBNDB::Simple ACCESSID => 'XXXXXXXX'; my $isbn = ...; my $href = Book( $isbn );

Is left as an exercise :)


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re: Understanding how to *use* a CPAN module by BrowserUk
in thread Understanding how to *use* a CPAN module by bradcathey

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.