[Catalyst] odd interaction between DBM::Deep::Hash and TT
Daniel McBrearty
danielmcbrearty at gmail.com
Sun Jul 8 09:05:54 GMT 2007
Hi,
I'm posting this to the cat list and the TT list as it seems to be of
interest to both groups of users.
I have a hash which is made persistent with DBM::Deep. I pass the hash
straight through the controller to the template ( $c->stash->{hash}
= $h; ), then iterate like this:
[%- FOREACH k in hash.keys -%]
<p> [%- k -%] </p>
[%- END -%]
I also dump the hash with $c->log->dumper in the controller, and see this:
[debug] $VAR1 = bless( {}, 'DBM::Deep::Hash' );
so I know an empty blessed hash is being passed.
But in the html out, I see :
<p> keys </p>
If I patch the controller so $c->stash->{hash} = {};
the problem goes away.
Is this some TT bug that interacts with DBM::Hash ? autovivifying
"keys" as a key not a function?
thanks
Daniel
--
Daniel McBrearty
email : danielmcbrearty at gmail.com
http://www.engoi.com
http://danmcb.vox.com
http://danmcb.blogger.com
find me on linkedin and facebook
BTW : 0873928131
More information about the Catalyst
mailing list