in reply to Using my and library....
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Using my and library....
by kiat (Vicar) on Aug 17, 2002 at 12:29 UTC | |
by tadman (Prior) on Aug 17, 2002 at 13:15 UTC | |
by Anonymous Monk on Aug 17, 2002 at 13:01 UTC | |
by smalhotra (Scribe) on Aug 17, 2002 at 14:04 UTC | |
by kiat (Vicar) on Aug 18, 2002 at 13:03 UTC |