in reply to Why is it uninitialized?
I'm as surprised as you are. Only thing I see is that for doesn't *set* the loop variable AFAIK, but it turns it into an alias (if you had had other variables in your list, no new value would have been created, but $S4 would have pointed to the existing scalars). So it looks like the closure still looks at the previous scalar, bypassing the aliasing mechanism.
|
|---|