my @sorted = sort { $$a[0] <=> $$b[0] } @{$simulations[$simulation_index]->{"SPECIAL"} }; $simulations[$simulation_index]->{"SPECIAL"} =\@sorted;