in reply to LWP::Simple vs HTTP::Tiny

Hello Bod (and my even if late, warmest welcome to the monastery!)

In my opinion if there is something in core, use it. HTTP::Tiny has been in core since 5.14

I suppose cpan client can use different http clients, but I never investigated this.

The author of HTTP::Tiny wrote a nice introduction with comparisons too: why HTTP::Tiny

Back in time we had only LWP::* modules to use and many of us used them a lot. Nothing bad to still using them as they still work great. But there are many and newer and better nowadays: Mojo::UserAgent is worth a mention among them.

L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Replies are listed 'Best First'.
Re^2: LWP::Simple vs HTTP::Tiny
by Bod (Parson) on Dec 13, 2020 at 13:49 UTC
    Hello Bod (and my even if late, warmest welcome to the monastery!)

    Thank you very much indeed - I certainly feel welcomed by many long standing, esteemed Monks. Joining in rather than just observing occasionally is something I should have done a long, long time ago and I strongly wonder why I didn't whilst at the time speculating how much improved by Perl and general coding skills would be had I joined many years ago!

    The author...wrote a nice introduction with comparisons too: why HTTP::Tiny

    Thank you. I had already read that and it compares HTTP::Tiny to the full blown LWP::UserAgent. I totally understand the need for a smaller HTTP module which LWP::Simple provides.

    It was CPAN's choice of HTTP module which confuses me when it has the option of both, it prefers LWP::Simple.

      I totally understand the need for a smaller HTTP module which LWP::Simple provides.

      Just in case you were unaware, LWP::Simple is just a wrapper around LWP::UserAgent. The "Simple" refers to the simplified interface only. In using LWP::Simple instead of LWP::UserAgent you are actually consuming more RAM, not less and loading more modules, not fewer.

      Update: Edited for clarity.


      🦛

        Just in case you were unaware...

        Thank you hippo - I did know that LWP::Simple is a wrapper but I hadn't extrapolated that to understand the implications you have pointed out. Obvious really but easily missed (at least it is by me).

        I am using HTTP::Tiny for the Raspberry Pi project mainly because this module is core. Having used it for this, I think it will be my first choice when I need simple web access.