![]() |
|
laziness, impatience, and hubris | |
PerlMonks |
Re: non-autovivifing hashby toma (Vicar) |
on Jul 03, 2003 at 00:32 UTC ( #271025=note: print w/replies, xml ) | Need Help?? |
I agree that it would be nice to have more level of
control over autovivification. As tye suggests,
sometimes only one level of autovivification is desired.
Someone else might want at most two levels, such as when
working with 2D arrays. A debugger could be enhanced with an object that could provide this level of checking. This debugging object would contain a pointer to a variable whose autovivification is being monitored. Perl's debugger hooks could check autovivification constraints on a line-by-line basis at run-time. After the program starts working, the run-time checking could easily be turned off. This is the sort of problem that I have trouble debugging with print statements, but I can easily debug with the ptkdb debugger. I just put the hash in the watch variable window and see how it grows. Or, if the data structure being monitored is too large, I put something like scalar(keys %myhash) in the watch window. I've already been flamed each time that I have mentioned debuggers, so maybe we can skip that part this time! It should work perfectly the first time! - toma
In Section
Seekers of Perl Wisdom
|
|