[Templates] Re: odd interaction between DBM::Deep::Hash and TT
Randal L. Schwartz
merlyn@stonehenge.com
Sun, 08 Jul 2007 08:29:56 -0700
>>>>> "Daniel" == Daniel McBrearty <danielmcbrearty@gmail.com> writes:
Daniel> ok, solved it
Daniel> http://search.cpan.org/~merlyn/Template-Plugin-DBM-Deep-0.02/lib/Template/Plugin/DBM/Deep.pm
Daniel> "Caution: VMethods do not work against the hash-like or array-like
Daniel> objects. However, you can use the export method to get an unattached
Daniel> cloned copy of that portion of the database, and then the normal
Daniel> vmethods work:
Daniel> "$key\n" FOR key IN db.export.keys;
Daniel> Failure to export first will result in attempting to access a hash
Daniel> element called keys, which doesn't exist."
Daniel> silly me .. :-)
Yeah. When I wrote that, I contemplated suggesting that TT look first to see
if there's array-ish or hash-ish behavior before checking for being blessed,
but that'd break every other use of objects. :)
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!