1#!/usr/bin/perl
2###########################################
3use warnings;
4use strict;
5
6use Net::Amazon;
7
8#use Log::Log4perl qw(:easy);
9#Log::Log4perl->easy_init($DEBUG);
10
11my $ua = Net::Amazon->new(
12    associate_tag => $ENV{AMAZON_ASSOCIATE_TAG},
13    token         => $ENV{AMAZON_TOKEN},
14    secret_key    => $ENV{AMAZON_SECRET_KEY},
15    locale      => 'uk',
16);
17
18die "usage: $0 ean\n" unless defined $ARGV[0];
19
20my $resp = $ua->search(
21   ean  => $ARGV[0],
22   mode => 'DVD',
23);
24
25if($resp->is_success()) {
26   print $resp->as_string(), "\n";
27} else {
28   print "Error: ",
29         $resp->message(), "\n";
30}
31