good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Limiting array size?by lhoward (Vicar) |
on Jul 05, 2001 at 23:45 UTC ( [id://94231]=note: print w/replies, xml ) | Need Help?? |
You could do it transparently by using ties (once you implemented the tie). Depending on how you want to limit it your STORE sub would check the current array size and act apropriately if it would cause an overflow (reject the insert, throw out some data already in the array, die, etc...). If you're wanting to do this to implement a limited size cache there are already modules out there to do that (Tie::Cache, Tie::Cache::LRU, etc..).
In Section
Seekers of Perl Wisdom
|
|