#!/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 %recommendations; ## 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 = {}; #### recommendation_movies() Return a list of recommended movies for specified one as a hash 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 similar to that: __DATA__ $VAR1 = { '0416449' => '300', '0167260' => 'The Lord of the Rings: The Return of the King', '0442933' => 'Beowulf', '0320661' => 'Kingdom of Heaven', '0172495' => 'Gladiator' };