I gave this a try but had no luck. Here's what I did:
#!/usr/bin/perl use strict; use warnings; use diagnostics; use Data::Dumper; use IMDB::Film; my $imdbObj = new IMDB::Film(crit => 'Casablanca'); my $recommendations = $imdbObj->recommendation_movies(); # Attempt to print out values from recommendation_movies() my %recommendations; print map { "$_ => $recommendations{$_}\n" } values %recommendatio +ns; ## Doesn't return anything ## # Debugging to see what's in recommendation_movies() $imdbObj->status ? print "$recommendations\n" . Dumper($recommendations) . "$imdbObj->recommendation_movies()\n" . Dumper($imdbObj->recommendation_movies()) : print "ERROR: $imdbObj->error"; __END__ RETURNS: HASH(0x100a385a8) $VAR1 = {}; IMDB::Film=HASH(0x100805140)->recommendation_movies() $VAR1 = {};
I checked the IMDB::Film source code for recommendation_movies()
recommendation_movies() Return a list of recommended movies for specified one as a has +h where each key is a movie ID in IMDB and value - movie's title +: $recommendation_movies = $film->recommendation_movies( +); For example, the list of recommended movies for Troy will be s +imilar to that: __DATA__ $VAR1 = { + + '0416449' => '300', + + '0167260' => 'The Lord of the Rings: The Return of t +he King', + '0442933' => 'Beowulf', + + '0320661' => 'Kingdom of Heaven', + + '0172495' => 'Gladiator' + + };

I tried printing  $recommendation_movies but got an 'ERROR: Can't call method "$recommendation_movies" on an undefined value'

Sorry but that's as far as I got. Hopefully some of this information will help you (or help someone help you) get a little closer to solving the problem.

*Quick side note: You may want to change the title of your post to something like: "Print Hash Values From IMDB::Film". Although your title is funny, it doesn't really do very much for your question. You'll have more luck getting monks to view your post with something that clearly and succinctly describes your problem.

Good luck! It's a fun module ( for me at least :) ) thanks for posting the question.
Luis

"...the adversities born of well-placed thoughts should be considered mercies rather than misfortunes." — Don Quixote

In reply to Re: help a Dutchman with hash (IMDB::Film) by luis.roca
in thread help a Dutchman with hash by nrbrtkls

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.