Craig Barratt wrote:
> 
> At 05:43 PM 9/24/2001 -0400, Brian Hann wrote:
> >That didn't work. I tested just setting normal scalar variables within the
> >template, since I figured my OUT.loop.count stuff was wrong; still no
> >workie.  I'm guessing the variables passed to TT are cloned, which makes
> >them read-only, right?  Is there any other way to output select processed
> >content to multiple variables?
> 
> Andy's fix should do it.  Yes, variables are cloned, so any new
> variables are lost before process returns.  Since you preset OUT
> to an empty array you should be ok: although OUT is cloned (but only
> skin-deep), setting OUT.0, OUT.1 etc should still be visible
> after process returns.
> 
> As an aside, it would be nice to have top-level cloning by process
> be optional, because there are cases, like your's, where you want
> to get to variable values after process returns.  For now you either
> have to get to the variables inside a POST_PROCESS (since that is
> inside the clone), or set entries of lists or hashes that already
> exist.

If there's a switch for top-level cloning to be optional, how about one
to make the cloning total - the entire variable's structure is cloned.  
Particularly useful with ties.  In my example I use SPOPS-created
class objects which are tied to a DB.  I'd like to simply provide the
template with the variable.  However, since I'm letting any user edit
the templates (they make their own copy of rather than editing the
main template) this is dangerous.  At the moment I clone the entire
structure by hand, but it would be nice not to do this (or if anyone
has another suggestion?).

Robert


Reply via email to