A slight aside here. I try to use global vars sparingly. At my work I notice the most common use of them is to define site specific info (paths to filenames, database names etc.) For those kind of thing that do
not change during the running of a script, I perfer to use
constant. For me I've found that it makes the purpose of the statement a little clearer as well as not having to be concerend with scope for those things.
Also I perfer not to use global varibles in several files. When i have to make a change it means I have to open several copies of vi as well as testing the impact on all the scripts. When I use outside files like they are usually subs. I try to define an API for the the subs and and when I update one I can update the wy it handles the passed data so I generally don't hve to change the way the sub is called. One of these days I'm going to try to move them into a 'package' based system.