sub STORE { my ($self, $index, $value)= @_; ... if index is in range, store item in my array ... else store it to the file. ... if I appended more elements and hit my high-water .... mark, swap out lower items and adjust my range. }