1#!/usr/bin/perl 2########################################### 3use warnings; 4use strict; 5 6use Net::Amazon; 7 8use Log::Log4perl qw(:easy); 9Log::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 response_dump => 1, 16); 17 18my $resp = $ua->search( 19 asin => $ARGV[0], 20); 21 22if($resp->is_success()) { 23 print $resp->as_string(), "\n"; 24} else { 25 print "Error: ", 26 $resp->message(), "\n"; 27} 28