Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
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" ); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Cache::MemoryCache
by diotalevi (Canon) on Jul 19, 2003 at 00:31 UTC | |
|
Re: Cache::MemoryCache
by sauoq (Abbot) on Jul 19, 2003 at 00:34 UTC | |
by Anonymous Monk on Jul 19, 2003 at 00:51 UTC | |
by zengargoyle (Deacon) on Jul 19, 2003 at 04:57 UTC | |
by perrin (Chancellor) on Jul 19, 2003 at 20:58 UTC | |
by diotalevi (Canon) on Jul 19, 2003 at 01:00 UTC | |
by sauoq (Abbot) on Jul 19, 2003 at 01:03 UTC | |
|
Re: Cache::MemoryCache
by fglock (Vicar) on Jul 19, 2003 at 02:46 UTC |