Robin Smidsrød wrote:
Randal L. Schwartz wrote:
One a sidenote, is there some way for an object method to know if it is being called from a template (instead of from normal perl code)? Is there some variable that is set that the function has access to which is not set otherwise? Or can I use some kind of function (caller) to inspect the call stack to figure it out? My object contains both read and write methods, and I want to make sure the write method calls are not callable from within a template, only from native perl code. Any pointers would be most helpful.

If you have access to all the code, you could just set a global variable right 
before processing the template and then check for that in your function.

-- Josh

_______________________________________________
templates mailing list
[email protected]
http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to