Installing Net::Amazon::MechanicalTurk on recent version of Perl

If you tried to install Net::Amazon::MechanicalTurk via cpan/cpanm command you likely get something like this:

Building and testing Net-Amazon-MechanicalTurk-1.02
Building Net-Amazon-MechanicalTurk
defined(%hash) is deprecated at /home/joe/.cpanm/work/1354249022.18998/Net-Amazon-MechanicalTurk-1.02/blib/lib/Net/Amazon/MechanicalTurk/ModuleUtil.pm line 35.
(Maybe you should just omit the defined()?)
# Testing Net::Amazon::MechanicalTurk 1.02, Perl 5.014002, /usr/bin/perl
t/00-load.t ............................... ok
defined(%hash) is deprecated at /home/joe/.cpanm/work/1354249022.18998/Net-Amazon-MechanicalTurk-1.02/blib/lib/Net/Amazon/MechanicalTurk/ModuleUtil.pm line 35.
(Maybe you should just omit the defined()?)
Can't locate object method "new" via package "Net::Amazon::MechanicalTurk::Transport::RESTTransport" at /home/joe/.cpanm/work/1354249022.18998/Net-Amazon-MechanicalTurk-1.02/blib/lib/Net/Amazon/MechanicalTurk/Transport.pm line 21.
t/01-ListOperations.t ..................... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run 
defined(%hash) is deprecated at /home/joe/.cpanm/work/1354249022.18998/Net-Amazon-MechanicalTurk-1.02/blib/lib/Net/Amazon/MechanicalTurk/ModuleUtil.pm line 35.
(Maybe you should just omit the defined()?)
Can't locate object method "new" via package "Net::Amazon::MechanicalTurk::Transport::RESTTransport" at /home/joe/.cpanm/work/1354249022.18998/Net-Amazon-MechanicalTurk-1.02/blib/lib/Net/Amazon/MechanicalTurk/Transport.pm line 21.
t/03-api-CreateHIT.t ...................... 
Dubious, test returned 2 (wstat 512, 0x200)
No subtests run

Funny thing - it works on Perl 5.8.9 per someone on Stackoverflow. Turned out even that it's just a notice "defined(%hash) deprecated", this is really what cause problem. If you remove it from line 35 of Net/Amazon/MechanicalTurk/ModuleUtil.pm - problem disappear!

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.

To submit this form you need to use Internet Explorer v10+ or recent version of Chrome, Firefox or Safari.