You're referring to it correctly, but use happens at compile time and you're not changing $::var until runtime. You either need to wrap the assignment in your main program in a BEGIN block, or you need to come up with a better method of passing things to your module (consider an import() routine so you could say use MyModule 'value', or implement accessors of some form (MyModule::setVar( "value" ) for example).
Consult perldoc -f use and perldoc perlmod for further enlightenment.
In reply to Re: Packages and modules
by Fletch
in thread Packages and modules
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |