It doesn't matter what you're trying to do, but this is a bad way of going about it. You'll be much better off just passing variables as arguments to functions or by declaring them global there.
but in short, there is no simple way to do it without a lot of global statements.