our %prod; creates an alias named %prod to the variable %PKG::prod, where PKG is the package in which the our is located.
The alias exists until the end of the lexical scope (curlies or file).
# ModuleA.pm package ModuleA; our %prod; # %prod is aliased %ModuleA::prod package ModuleA::Helper; # %prod is still aliased %ModuleA::prod 1;
# ModuleB.pm package ModuleB; our %prod; # %prod is aliased %ModuleB::prod 1;
In reply to Re: our scope and packages
by ikegami
in thread our scope and packages
by jfrm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |