in reply to Re: Fill an array in a module ?
in thread Fill an array in a module ?
print MyModule::SharedArray[1]; # prints 2
Should be $MyModule::SharedArray[1] The variable name still needs a sigil for full qualification.
In Perl, each module has its own namespace.
Each module can be given its own namespace (as shown in the code example via package) or, indeed, any namespace. It's not automatic.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Fill an array in a module ?
by Anonymous Monk on Sep 14, 2014 at 05:18 UTC | |
by dsheroh (Monsignor) on Sep 14, 2014 at 07:59 UTC | |
by RonW (Parson) on Sep 15, 2014 at 16:39 UTC | |
|
Re^3: Fill an array in a module ?
by DarrenSol (Acolyte) on Sep 17, 2014 at 17:15 UTC |