Perhaps Tie::Array::BoundedIndex? Never used it, but it looks to fit the bill.
In reply to Re: size of array by Fletch in thread size of array by Angharad