in reply to problem with global variables going out of scope

You've got a $showPUV declared with my at the top, and one declared with our in the sub. Is that what you want? They are different variables, the former being declared lexically, and the latter being a global.

You don't say specifically what variable goes out of scope when, so it's hard to tell you why it's happening.

You might find Coping With Scoping to be enlightening.


Caution: Contents may have been coded under pressure.