The basic idea is that instead of creating an instance of a class, you would create an instance of the autovivifying class that calls an initialization function the first time it needs to
This smakes of a solution looking for a problem.
Two questions:
Smacks of a bad cure for a bad scoping problem; better corrected by correctly scoping the instantiation.
Quantify the benefit.
A third question: Why does your "example of usage" not actually run?
C:\test>t-autoVivify.pl Can't locate object method "new" via package "autovivify" (perhaps you + forgot to load "autovivify"?) at C:\test\t-autoVivify.pl line 29.
In reply to Re: Automatic vivification of an object
by BrowserUk
in thread Automatic vivification of an object
by bounsy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |