my $scalarref = \$devstats; $scalarref = \$$scalarref->{$_} for @data[4..$#data]; $$scalarref = $value;