[htmltmpl] Which templates exist in shared memory?
Brought to you by:
samtregar
From: Flemming M. L. <ma...@op...> - 2002-07-16 20:19:45
|
Hi! We're currently developing a fairly large extranet and using a lot of HTML::Template's. Due to this we switched to using the shared_cache, and I've gotten curious as to which templates is loaded when. I'm sure someone must have a recipe on how to print a neatly formatted list of which templates are loaded into shared memory (and preferably a timestamp telling when the template was loaded. Could that someone please post an example to the list? I did try the following, which do tells me which template are loaded, but there must be a smarter way to go about it: <sample> #!/usr/local/bin/perl -w use strict; use IPC::SharedCache; my %self; tie %self, 'IPC::SharedCache', ipc_key => 'TMPL', ipc_segment_size => 65536, load_callback => sub {}, validate_callback => sub {}; print "Content-type: text/plain\n\n"; print "(Shared memory) Cached templates :\n"; for (keys %self) { print "* $_\n"; my $template = $self{"$_"}; } </sample> (( Flemming )) -- Flemming Mahler Larsen, Online Technology @ TDC Internet http://card.netfactory.dk/ , +45 3552 6452 |