in reply to Re^2: Access a global variable from a subroutine when used as "for" iterator
in thread Access a global variable from a subroutine when used as "for" iterator
Closures are not generally smelly, but global variables almost always are. My impression is the OP was aiming for a global variable rather than a closure. Very likely if a closure is intended by an OP the fact is mentioned because that has a strong influence on the expected behavior of the code. No mention, no closure.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Access a global variable from a subroutine when used as "for" iterator
by vitoco (Hermit) on Dec 21, 2023 at 04:49 UTC |