I have been trying to figure out hash of hashes. I have found a few URLs, but the examples aren't clicking. Here is the code I am playing with and output.
use Net::Amazon; my $ua = Net::Amazon->new(token => 'xxxxxxxxxxxxxxxxxxxx', locale => ' +us'); my $response = $ua->search(browsenode=>"3839", mode=>"books", keywords +=>"perl"); if ($response->is_success()) { for my $prop ($response->properties) { $books{$prop->publication_date()}{'title'} = $prop->t +itle(); $books{$prop->publication_date()}{'authors'} = join(", ",$p +rop->authors()); $books{$prop->publication_date()}{'isbn'} = $prop->isbn( +); $books{$prop->publication_date()}{'pages'} = $prop->numpa +ges(); $books{$prop->publication_date()}{'publisher'} = $prop->publi +sher(); $books{$prop->publication_date()}{'image_small'} = $prop->Image +UrlSmall(); $books{$prop->publication_date()}{'image_medium'} = $prop->Image +UrlMedium(); } print Dumper %books; }
Data Dumper outputs
$VAR1 = '2005-07-12'; $VAR2 = { 'image_medium' => 'http://ecx.images-amazon.com/images/I/21m +kODqYmdL.jpg', 'authors' => 'Damian Conway', 'title' => 'Perl Best Practices', 'isbn' => '0596001738', 'publisher' => 'O\'Reilly Media, Inc.', 'image_small' => 'http://ecx.images-amazon.com/images/I/11Ol +nA6slCL.jpg', 'pages' => '542' };
I expected $VAR2's content to be under $VAR1? On a side note, does anyone know why there is a "\" in "O'Reilly" in the publisher key?

In reply to Hash of Hashes by ewhitt

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.