I frequently read nodes criticising global variables, and I think I might be guilty of using one, but I'm not sure:
I'm traversing a Binary Search Tree looking for a particular value, but there could be more than one node where it occurs...So, I set up an array in my main package, and pass a reference to it to the recursive traversal subroutine in the Tree object. This traverses the whole tree, and every time there's a match, pushes the current node to this array.
So that's it: one object is pushing values to an array in another (in real life the call isn't from main). Incidentally, it works. But I have a feeling I'm breaking some fundamental OO rules, or maybe this is an example of a ghastly global variable? I've even read nodes saying that I shouldn't be passing by reference at all, but I'm not too fussed about that.
edited: Mon Jul 1 18:48:44 2002 by jeffa - title change