> 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?).
Yes, this could be an option inside TT. But it's pretty easy to use
Storable's dclone when you call process:
use Storable qw(dclone);
....
$template->process($input, dclone($vars));
There is also the Clone module on CPAN.
Craig