package cache { # no particular reason to use them, # but the syntax sugar is *so* sweet use experimental 'signatures'; use base 'Storable'; my %paths; sub new($class,$path) { my $self = eval { return Storable::retrieve($path) } || bless {}, $class; $paths{$self} = $path; return $self; } sub DESTROY($self) { $self->store($paths{$self}); } }