in reply to Re: Using variables, arrays etc from a perl module in main script.
in thread Using variables, arrays etc from a perl module in main script.
Notice above I use the scope operator. With our the scope operator is not needed. The name of variable $bar in package Foo is $Foo::bar; however, when we declare $bar with our (i.e., our $bar; ), then to access $bar outside of package Foo we do not need the scope (i.e., $Foo::bar becomes just $bar).
While it may simply be a language issue, the above sounds incorrect to me. While our does make @xyz::array globally accessible, it is only accessible using a fully qualified package name (@xyz::array) outside its package (xyz) unless it is exported/imported. I am uncertain what you mean by the "scope operator" - do you mean the package name with double colon?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Using variables, arrays etc from a perl module in main script.
by walkingthecow (Friar) on May 12, 2010 at 19:40 UTC | |
by kennethk (Abbot) on May 12, 2010 at 19:46 UTC | |
by Anonymous Monk on Feb 27, 2014 at 05:19 UTC |