You can create scalar references to $ini and $last, and use these references in your %results hash. Then when you change the values of $ini and $last, the hash will refer to the changed values. Read up on references here - perlref
my $ini = 5;
my $ini_ref = \$ini;
print $$ini_ref; # outputs 5
$ini = 6;
print $$ini_ref; outputs 6