Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Forcing context of dot operator in Template Toolkit

by agianni (Hermit)
on Oct 26, 2007 at 19:11 UTC ( #647471=note: print w/replies, xml ) Need Help??

in reply to Forcing context of dot operator in Template Toolkit

Hey, so it turns out I got this working after all. There was a bug in my test that was forcing the object context. I missed the fact that the original author of the test had overridden my method to explicitly return an object all of the time :)

This is to say that now the template always pulls back the hashref instead of the object from Contextual::Return. This works fine for me since it is backwards compatibility from a hashref model that I'm looking for. So in the mean time, I have bi-directional flexibility in my controller code and access to hashrefs in my templates. I have accounted for this by creating entries in the hashref with names identical to the method accessors, so I can call:



which both give me the same value, and while the later looks like a method call, it's actually just a hash entry. It's a total kludge, but that's all I'm after right now.

perl -e 'split//,q{john hurl, pest caretaker}and(map{print @_[$_]}(joi +n(q{},map{sprintf(qq{%010u},$_)}(2**2*307*4993,5*101*641*5261,7*59*79 +*36997,13*17*71*45131,3**2*67*89*167*181))=~/\d{2}/g));'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://647471]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2018-06-23 05:08 GMT
Find Nodes?
    Voting Booth?
    Should cpanminus be part of the standard Perl release?

    Results (125 votes). Check out past polls.