>>>>> "Nick" == Nick Woolley <[EMAIL PROTECTED]> writes:
Nick> I know I could just pass the object as a value within a hashref. But
Nick> this is frustrating, since it forces me to add a redundant prefix to all
Nick> the variable names used in the template. Or I could unbless the object,
Nick> but that's assuming it is a hash-based object, and the values I want are
Nick> stored in the hash. And there are other hacks I could try, but they get
Nick> increasingly clumsy and long winded.
I'm unclear on what you would like the syntax look like at the TT level if you
don't want "a redundant prefix". Do you want all of the object's methods
(which isn't clearly defined in Perl) to become individual globals somehow?
Or maybe the objects member variables (which also isn't clearly defined)
to become globals? Or both?
What are you trying to accomplish?
Our solution was simply pass { mine => $obj } as the globals, and
then live with:
[% mine.a_method %]
[% mine.another_method(some, parameters) %]
which maps the method calls back to the object cleanly.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> <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!
_______________________________________________
templates mailing list
[email protected]
http://mail.template-toolkit.org/mailman/listinfo/templates