note
Rhandom
If the cache needs to be shared among children - I second the vote for memcache.
<br><br>
If each child needs its own, I'd do something like the following using the [cpan://End] module:
<br><br>
<code>
# add clear_cache method to your sharedcache
package sharedcache;
sub clear_cache { $cache = undef }
# inside your apache handler use the following:
use End;
sub handler {
my $clear_cache = end { sharedcache::clear_cache() };
# normal handler operations go here
}
</code>
<br><br>
When your handler goes out of scope - the object stored in $clear_cache will go out of scope and the stored coderef will fire - clearing your cache.
<br><br>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-1598">
<font size=1>my @a=qw(random brilliant braindead); print $a[rand(@a)];</font>
</div></div>
672185
672185