in reply to Re^2: Which "use" statements in a module do "bubble up" to the callers? [SOLVED]
in thread Which "use" statements in a module do "bubble up" to the callers? [SOLVED]
use is require followed by import, no more and no less.
I agree that the parent could be worded better, but if we're being nitpicky, that's also not quite right. use Module VERSION LIST (where both VERSION and LIST are optional) is equivalent to:
BEGIN {
require Module;
Module->VERSION( VERSION ); # if VERSION was specified
Module->import( LIST ); # *except* when LIST is "()"
}
And use VERSION; requires a minimum version of Perl. That's all use does, and whether the Module is a prgama, regular module, or whatever else, is up to that module and its import, not use. Update: Well now I need to nitpick myself - use VERSION; also enables the feature bundle for that version and strict if the version is 5.12 or greater. Also, it should be noted that if Module doesn't have a sub import, no error is raised.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Which "use" statements in a module do "bubble up" to the callers? [SOLVED]
by Anonymous Monk on Sep 01, 2017 at 15:08 UTC |