Should I declare them as "our" variables, or should I just create a subroutine in the module and pass copies of the variables to the scripts by way of the subroutine, or would something else be better?
Either is ok, but which is best depends solely on the purpose of the modules and the data encapsulation that is required. Are the variables read-only? would setting the variables to some value have nefarious consequences? are they subject to security concerns?
There are many ways to do what you are after, e.g. have a look at the Config.pm code for an implementation of a read-only hash.
Rules of thumb:
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
In reply to Re: How to make Common Variables defined in Module available to Scripts
by shmem
in thread How to make Common Variables defined in Module available to Scripts
by memnoch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |