in reply to What are the advantages or disadvantages of "require" over "use"
If a module has a compile-time effect (exporters and pragmata), then use use. Otherwise (e.g. for OO modules), you can choose.
A good reason to go with require would be when loading a module that isn't always needed. Say you are writing a module that offers load_from_file and load_from_web functions. In this case you might want to require LWP::UserAgent (or HTTP::Tiny or whatever) inside the definition of load_from_web. That way, if the person using your module never needs to load anything from the web (they only ever load from files), they can avoid loading LWP::UserAgent at all.
|
|---|