1#!/usr/bin/perl -w 2 3use strict; 4use IMDb; 5 6my $id = shift @ARGV; 7 8my $imdb = new IMDb 'title', "$id" 9 or die "can't create an IMDb object"; 10 11foreach(qw(title year cover_url rating votes genres)) 12{ 13 printf "%s: %s\n", ucfirst $_, join(', ', $imdb->$_()); 14} 15 16foreach($imdb->get_character_fields) 17{ 18 print "-------------------------------------\n"; 19 print ucfirst $_ . ":\n"; 20 print "-------------------------------------\n"; 21 foreach($imdb->$_()) 22 { 23 print "$_->{name} aka $_->{role}\n"; 24 } 25} 26