in reply to Making a variable in a sub retain its value between calls

The other way to do this, if you don't want to make that data global, is to use objects. Objects are a good way to package up some behaviors (subroutines) with some data.
  • Comment on Re: Making a variable in a sub retain its value between calls