in reply to Choosing the right module

So, which would you choose and why?

In almost every URL-fetching case I use LWP::UserAgent because it is the most flexible of those you have listed. Even for a trivial action I think it is worth it because at some point in the future something about that particular process will change and possibly in a way that might not be supported by one of the "simpler" modules. Starting with the most flexible module saves re-engineering the code if/when that situation arises.

There may be other concerns which might count against it for a particular purpose, of course. I have yet to find one which is a showstopper.

More importantly, how do you generally make choices like these?

It is a balancing of the various criteria discussed in the I am most likely to install a new module from CPAN if: poll and thread.


🦛

Replies are listed 'Best First'.
Re^2: Choosing the right module
by Bod (Parson) on Oct 23, 2022 at 16:22 UTC
    Even for a trivial action I think it is worth it because at some point in the future something about that particular process will change and possibly in a way that might not be supported by one of the "simpler" modules

    Interesting...
    This is not a selection criterion I had considered but it totally makes sense.

    A few times I have created something using LWP::Simple, that used to be my go to web module, only to have to change to LWP:UserAgent later on because I needed to access or set something that wasn't available using LWP::Simple. More recently I have generally used HTTP::Tiny but for no other reason than it being core. That in itself is not a good enough reason for anything that doesn't need to be portable as both the LWP modules are installed on my system.