Unforuately, a reference to the object must be passed to the function, and the OP explicitely requested that the solution didn't do this. I do like passing a state object as you suggest, though. There's much less hidden mojo that way.
Sorry for this banal reply. The original version of it was completely wrong.
In reply to Re^2: Making a variable in a sub retain its value between calls
by ikegami
in thread Making a variable in a sub retain its value between calls
by crashtest
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |