#!/usr/bin/perl use strict; # https://perlmonks.org/?node_id=11148149 use warnings; use Storable; my $filename = '/tmp/d.11148149.testfile'; my $hashref = eval { retrieve $filename } || {}; use Data::Dump 'dd'; dd $hashref; # was $hashref->{+time} = 1; # do something with $hashref... use Data::Dump 'dd'; dd $hashref; # is now store $hashref, $filename;