where to declare variables

This is an more abstract question. I know the difference between global and local variables, but should i only declare variables as global when I know they need to be global? Or is it considered ok practice to declare variables that may or may not need to be global as global?

Thanks.
In general, global variables tend to be frowned upon -- just use local variables and pass them as parameters to other functions that need them.

Related reading:
http://stackoverflow.com/questions/484635/are-global-variables-bad
thanks!
Topic archived. No new replies allowed.