Is there a way to get a variable in a proc that maintains it's value 
between different calls of the proc?

I tried using an instance variable:
 p = proc { unless defined? @a
              @a = 1
            end
            puts @a
            @a+=1
          }
#<Proc:0x401bfdb0>
irb(main):024:0> p.call
true
NameError: undefined method `+' for true
        from (irb):22
        from (irb):18:in `call'
        from (irb):24

I'm not sure why @a became true...

Then I tried:

 p = proc{ unless defined? a
             a = 1
           end
           puts a
           a += 1
         }


....and of course all I ever get out of it is 1, but at least a doesn't 
become 'true'.


Phil