Am I doing programmatically something wrong in the following code?
No, you aren't.
The problem seems to be that they don't like user agents that identify themselves as "libwww-perl".
Set your user agent to something else and try it...
my $ua = LWP::UserAgent->new( agent => "something else" );
... worked for me. I got the unauthorized message before the change and afterward the response I got was:
Mymemory: {"responseData":{"translatedText":"Ciao mondo"},"responseDet
+ails":"","responseStatus":200,"matches":[{"id":"424913311","segment":
+"Hello World","translation":"Ciao mondo","quality":"74","reference":"
+","usage-count":50,"subject":"All","created-by":"","last-updated-by":
+null,"create-date":"2011-12-29 19:14:22","last-update-date":"2011-12-
+29 19:14:22","match":1},{"id":"0","segment":"Hello World","translatio
+n":"Ciao a tutti","quality":"70","reference":"Machine Translation pro
+vided by Google, Microsoft, Worldlingo or the MyMemory customized eng
+ine.","usage-count":1,"subject":"All","created-by":"MT!","last-update
+d-by":null,"create-date":"2012-05-12","last-update-date":"2012-05-12"
+,"match":0.85}]}
-sauoq
"My two cents aren't worth a dime.";
|