No, the autovivification pragma on CPAN tries to be what I described but it accomplishes it an unfortunately very complex way. It has to reimplement a bunch of Perl guts inside of the module. The level of hidden complexity is impressive, which makes the potential for subtle problems that are very hard to diagnose also high.
As much as I'd like a "don't autovivify" pragma, I won't use its 1800 lines of XS code given how many subtle bugs I've spent way too much time on from much, much fewer and simpler lines of XS so many times.
|