2ge has asked for the wisdom of the Perl Monks concerning the following question:
I'm running into following problem - I have to delete some keys from cache I am using, but don't know how. Here is code:
use strict; use warnings; use WWW::Mechanize::Cached; use Cache::FileCache; my $cache = new Cache::FileCache( { cache_root => '/usr/home/2get/tmp/filecache', default_expires => '365 days', cache_depth => 3, }); my $mech = WWW::Mechanize::Cached->new( cache => $cache, stack_depth => 10 ); my $url = "http://www.rulez.sk/headers.php"; $cache->remove($url) or warn "cannot remove: $!"; my $response = $mech->get($url); print $mech->is_cached() ? "$url was cached" : "$url was NOT cached";
problem is in $cache->remove($url), WWW::Mechanize::Cached doesnt save the file under key $url, but in its own (I look into cache file). Has someone idea how to delete this from cache?
Thanks a lot
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How delete key from cache, when using WWW::Mechanize::Cached
by 2ge (Scribe) on Jul 27, 2006 at 19:31 UTC |