in reply to Array mysteriously disappears on loop exit...

The my declaration is lexical, so when you return from the function if that code is in another file you could be leaving the scope of that array. Declaring with use vars should solve that.

But that said, using global like this is usually an indicator of poorly factored design. Instead design your code so that you return the array instead of manipulate it. That kind of design tends to be more flexible and ages much better.

  • Comment on RE (tilly) 1: Array mysteriously disappears on loop exit...