Don't ask to ask, just ask | |
PerlMonks |
Re: Doubt about fly-weight objects.by Anonymous Monk |
on May 17, 2005 at 16:18 UTC ( [id://457883]=note: print w/replies, xml ) | Need Help?? |
You can avoid adding your own caching by using Memoize:
use Memoize;
memoize('new');
This wraps your constructor with a caching version. It may not be faster, but the resulting code is cleaner.
In Section
Seekers of Perl Wisdom
|
|