Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Choosing the right module

by hippo (Archbishop)
on Oct 23, 2022 at 15:11 UTC ( [id://11147610]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11147610]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2026-02-08 20:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.