Over a long time I have eventually learned that you should never use a synchronous library when an asynchronous one exists - especially for anything that takes time - like remote communications.

The reason is that async code is going to be so much more flexible and has far more re-usability (and of course can be used as 'sync' code if you want).

So in this case I would go to AnyEvent::HTTP. The benefits over the 3 you mention is ability to simultaneously do multiple requests, and simultaneously handle user input to start new requests or abandon ones already in progress etc. This also gives you the flexibility to more easily convert your script/program to a on-demand service (example: your program could use AnyEvent::HTTPD to have its own web server where users could go to it in a webbrowser and on-demand get your program to do whatever it is that it does).

Furthermore, with modules like 'Promises' you can write async code very much like sync code.


In reply to Re: Choosing the right module by sectokia
in thread Choosing the right module by Bod

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.