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;
In reply to Re: How to save and reload my hash
by davidrw
in thread How to save and reload my hash
by lepetitalbert
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |