in reply to How to save and reload my hash
my $hostname = 'foo.bar.example.com' use Cache::FileCache; my $cache = new Cache::FileCache( { 'namespace' => 'HostInfo', 'default_expires_in' => 600 } ); my $cacheKey = $hostname; my $host_info = $cache->get( $cacheKey ); if ( not defined $host_info ) { $customer = get_host_info_as_hashref( $hostname ); $cache->set( $cacheKey, $host_info, "10 minutes" ); } return $host_info;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to save and reload my hash
by lepetitalbert (Abbot) on Nov 20, 2005 at 15:16 UTC | |
by Errto (Vicar) on Nov 20, 2005 at 17:28 UTC |