use Module; has two effects.
The first is to load the module. Obviously, this has a global effect. I would not want the module to load several times if it is used by more than one other module.
The second call is to call the import method. For most modules, this serves to export characters to the caller namespace so that these functions can be called without specifying their full package name. This, obviously, affects not only some part, since no one gives everyone under their own namespace. But it really is up to you.
Some import module methods, however, do something completely different. They change the way code is compiled in the lexical domain in which the directive is present. They are called pragmas. use strict; - an example of one. It makes sense to use these modules in the subsection. However, using use HTML::TreeBuilder::XPath; in sub does not make sense.
ikegami
source share