in reply to Re^2: Hash of Hashes
in thread Hash of Hashes
There is another way for Data::Dumper to display the results and that is by simply turning on the Useqq flag like this $Data::Dumper::Useqq = 1;, though it is not recommended. This way you'll get double quotes instead of single quotes.
As a side note, I don't know what you are trying to do with your code, but you may get into trouble if you try to get two books published on the same date. If that happens, from your code, the first book retrieved will get overwritten and you won't know it was ever there. My advice to overcome that situation is to make, for each date, an array of hash references with the other book properties.
Something like
if ($response->is_success()) { for my $prop ($response->properties) { my %info; $info{'title'} = $prop->title(); $info{'authors'} = join(", ",$prop->authors()); $info{'isbn'} = $prop->isbn(); $info{'pages'} = $prop->numpages(); $info{'publisher'} = $prop->publisher(); $info{'image_small'} = $prop->ImageUrlSmall(); $info{'image_medium'} = $prop->ImageUrlMedium(); push $books{$prop->publication_date()}, \%info; } print Dumper \%books; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Hash of Hashes
by Cody Pendant (Prior) on Mar 10, 2008 at 02:01 UTC |