Most of the objections I see to using global variables make sense since they refer to issues of multiple threads, thread safety, etc.
But in a small, single threaded
The problem is tracking down which bit of your last code modified the state of the global. Generally, you want to keep variables within the smallest possible scope so that you can more easily reason about them.