|
|
| Keep It Simple, Stupid | |
| PerlMonks |
Template::Toolkit and Contextual::Returnby jatill (Beadle) |
| on Sep 22, 2006 at 11:41 UTC ( [id://574395]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.jatill has asked for the wisdom of the Perl Monks concerning the following question:
I have a method that uses Contextual::Return to return either a hash or an object depending on how the method is called.
Ex: $self->my_method->get_age('phil') works, and so does $self->my_method->{age}{phil}. However, when I try to use this method from Template::Toolkit, I only get a value back for $self->my_method->{age}{phil}. I am guess this is because somewhere behind the scenes, Template::Toolkit is asking for all data as a hashref, so that's what my_method will always return. Is my guess correct? Is there a way to make Template::Toolkit behave 'intelligently', like the perl code works? Thanks. ~jeff
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||