I just finished writing an article for SysAdmin about lightweight persistent data solutions, and stumbled across DBM::Deep. Today, I'm combining that with Template, as in:
use Template; use DBM::Deep; my $t = Template->new; # create engine my $db = DBM::Deep->new("foo.db"); # create storage $t->process($my_template, { db => $db });We now have the db hash in the template which is effectively a permanent multi-level data structure. What's more, it can be safely shared between multiple processes (there are lock/unlock methods for critical regions).
This rocks. This module should be core. Down with MLDBM. Up with DBM::Deep!
Re:Well...
merlyn on 2004-05-19T16:52:49
Maybe you missed this:It means exactly that. After that date, you'll be able to read it on my site. Before that, yes, you'll have to get the original publication somewhere. Sorry, that's the rules.[Content embargoed until 00:00:00 01-Aug-2004 per publisher's agreement.]Re:Well...
zatoichi on 2004-05-19T19:50:13
That is cool. I usually get that mag anyway.:-)
-sam
Re:neat, but...
perrin on 2004-05-19T17:51:31
I take back the part about second-level updates: it handles these by TIE-ing the inner data as well. I guess this means it only works for standard Perl structures though, and can't store objects.