If it's a class calling itself, vs. an object (instance of the class) calling itself, why not use instance variables of the class? Or ... need more input on the exact problem. "Global variables" and recursion sound like a bad idea in general (could you not just pass the object through each recursive call?)