Global variables or lexicals with accessor functions are both possible, but I'd recommend having your subs return a reference to a hash of values keyed by the names you would have given the variables.
That strategy eliminates the problems presented by globals when more than one copy of your program may run for maintainability and in threaded applications.
Update: ++smallhotra for spotting the problem in your example, ++tadman for a good inequivalent rewrite. Struck a badly reasoned comment, replaced it by a better one.
After Compline,
Zaxo
In reply to Re: Using my and library....
by Zaxo
in thread Using my and library....
by kiat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |