in reply to Limiting array size?
Anyway, you should look at Tie::Array, specifically Tie::StdArray. I think you can override STORE and STORESIZE to do what you want (depending on what it is).