sub points_list(){ my $ref = shift; my %hash = %$ref; my @order; foreach $item (keys %hash){ @order[int($hash{$item})]=$item; } return \@order; }