in reply to Hash dereference breaks from 5.8.9 to 5.10.1

what the best way would be to fix the script to work correctly in both versions.

Yes, dereference the hash reference correctly, thusly:

$Hash_reference->{$values[0]} = \@values;