Those sort of decision depend a great deal on context. The OP is almost context free so showing the "complex" version provides a robust scale-able pattern and a good starting point for further discussion.
It's not clear to me how localizing the global (to the callback) variable avoids the need to pass the variable to the callback if the callback is out of line. Obviously if the callback is inline there is no need to pass in the variable and then it really doesn't matter what the scope of the variable is.
In reply to Re^3: how to assign output of Find() into a variable $
by GrandFather
in thread how to assign output of Find() into a variable $
by teddy6507
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |