#!/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" ); }