|go ahead... be a heretic|
Preventing autovivification while accessing valueby naikonta (Curate)
|on Jan 28, 2008 at 14:44 UTC||Need Help??|
I work a lot with complex data structures. When I need to access a value at some depth nested keys which not guaranteed to exist, I have to write,
in order to avoid autovivification. But I'm getting tired to do that in all over the file, for every Perl file I work on, with distinct CDSes. Once I thought that I might need to restructure my data, but it wasn't possible to do so and it's still not possilbe to restructure now. So I come up with this little tool after doing some searching with Super Search and CPAN without satisfying result.
Now I can write,
It's enough for my needs now. It can be extended further to also allow array references in the middle of the chain,
Or, to let us specify certain ref type (including non-ref) we want so it terminates if the ref type mismatches,
So, if you were on my shoes, was it worth for you?
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!