For some reason I can get the FileCache to work but not the memory Cache. This works just fine in the "Default" Namespace#!/usr/bin/perl -w use Cache::MemoryCache; my $cache = new Cache::MemoryCache(); my $customer = $cache->get($ARGV[0]); if( not defined $customer ){ print "setting cache\n"; $customer->{'email_address'} = 'foo@foo.com'; $customer->{'first_name'} = 'foo'; $customer->{'last_name'} = 'bar'; $customer->{'id'} = $ARGV[0]; $cache->set($ARGV[0], $customer, "10 minutes" ); }
#!/usr/bin/perl -w use Cache::FileCache; my $cache = new Cache::FileCache(); my $customer = $cache->get($ARGV[0]); if( not defined $customer ){ print "setting cache\n"; $customer->{'email_address'} = 'foo@foo.com'; $customer->{'first_name'} = 'foo'; $customer->{'last_name'} = 'bar'; $customer->{'id'} = $ARGV[0]; $cache->set($ARGV[0], $customer, "10 minutes" ); }
In reply to Cache::MemoryCache by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |