Hi there,
first off, sorry for the very late reply. HT::Pluggable is the last of my distros that isn't on github yet, since I've had some difficulty in accessing the original subversion repository. I'm still waiting on that for the history, but I do have a git-cpan import that may be good enough. There's a stub ready here:
http://github.com/rhesa/html-template-pluggable
On Sat Aug 29 12:49:14 2009, SILASMONK wrote:
Show quoted text> I have found that in order to use something like <TMPL_VAR
> NAME="world.hello"> with $template->param(world=>$world), it is important
> that $world->can('hello') is true. If the $world object is relying on
> AUTOLOAD this will not be true. The class code for $world can get round
> this by overriding the "can" function but it is not obvious that one
> would want to do this.
I suppose that's a fairly common issue, though I had always understood that if you use AUTOLOAD, then you should also override can().
http://www.modernperlbooks.com/mt/2009/12/is-it-can-it-does-it-and-robust-perl-5-oo.html
That said, I realise this isn't as common practice as it should be, so I propose we change some of the HT::Dot behavior. If the thing under consideration is blessed, then treat it as an object: instead of only checking $obj->can($method), also check if $obj->can('AUTOLOAD'). If it isn't blessed, we try treating it as a hash key. I think this is conceptually cleaner.
This change currently breaks the tests using Test::MockObject, but I suppose that's okay. I'd like to refactor the test suite anyway.
Expect something in the coming weeks.
Show quoted text> I suspect that this may be the underlying cause for #40714 as well.
No, that's a completely different issue. See that thread for more details.
Rhesa