Beware: Template considers this to be a blessed object, you can't call normal hash or array vmethods. However, you can call the export method on any part of the tree to get a normal unassociated data structure, which can then be used with normal vmethods.
In the template:use DBM::Deep; use Template; my $t = Template->new(); # create engine my $db = DBM::Deep->new( file => "foo.db", locking => 1, autoflush => 1, ); # create storage ... $t->process($your_template, { db => $db });
[% db.foo = { fred => 3 barney => 2 }; # make permanent addition db.foo.fred; # get "3" %]
|
|---|