Global Variables Are Everywhere
I have had this discussion several times now, and experienced a common misunderstanding of my argument, when I claim that someone has used a global variable inside a class. It's time to explain this once and for all.
A global variable, the way programming textbooks often explain it, is a variable defined at the top level of your program, and accessible to all units within. This is rightfully considered a Bad Thing(tm). When something is widely accessible, it becomes difficult to know what state it should be in when accessed next. The open access implies that you can never be sure who accessed it before, who will access it next, and in what ways. These questions are the Three Graces of Access (TGA).
Now, let's step outside the purely technical definition above, and look at a different case. A static variable in a class - i.e. a variable that is shared among all instances of that class. If the class is large enough, or variably used enough, then again, the answers to the TGA become the same as those for global variables: you can't answer. Therefore, despite not adhering to the textbook definition, that static variable is a global.
What about a singleton? A singleton is a class that can only create one instance of itself. Any attempt to create another instance simply returns the already existing instance. This is quite plainly a technical way to create a global variable without tripping the textbook definition. However, there are some cases when singletons are considered the best way to do things. For example, a log class that allows different units to write messages to a common log sink. In this case, we note that we don't actually care about the answers to the TGA, because it's clear that there are no side effects, that writing to the log does not effect state changes noticeable by other units.
So what defines a global variable is whether we can answer the TGA, and what governs its use is whether we care about the TGA. Once you understand that, you start seeing global variables in more places. One common occurence is in large classes with many members. These classes often have a name ending with "Manager". As the class grows and holds more and more members, the answers to the TGA become less and less clear. The classification of the classes members as global variables can therefore be fuzzy - at what point is clarity about the TGA low enough to merit classification as global variables? Well, clearly, at some point.
That's a good reason to keep an eye open and to occasionally refactor. It means that instead of applying dogma and textbook definitions, one needs to apply judgment. It also means that like a lot of other things that are "considered harmful", even globals have their uses, and we should learn what they are. But most of all, we should understand why some uses are legitimate and some not.