in reply to Re: 'if' pragma and modules with an empty import list
in thread 'if' pragma and modules with an empty import list
G'day beech,
"As you can see import is only called twice when the empty parens aren't present"
I may be missing the point your trying to make here. I would only expect import() to be called twice (once for each 'use G;'). The empty list is intended to stop import() from being called.
From use:
If you do not want to call the package's import method (for instance, to stop your namespace from being altered), explicitly supply the empty list:
use Module ();
Although the arguments to use if are (CONDITION, MODULE, ()) — see the 'perl -MO=Deparse ...' line from my OP — I'm resonably sure the third argument (the empty list) is lost due to @_ being flattened; the version of @_, used by goto &work in if::import(), no longer has that empty list.
Anyway, as I said, I think I may be missing some point you're making. If you'd care to clarify, I'd be happy to discuss further.
— Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: 'if' pragma and modules with an empty import list
by beech (Parson) on Apr 11, 2017 at 08:01 UTC | |
by kcott (Archbishop) on Apr 11, 2017 at 22:12 UTC |