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.";

In reply to Re: MyMemory API by sauoq
in thread MyMemory API by welle

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.