For each of the five keys I have I'm retrieving the second key and corresponding value from a double hash - then I want to sort those according to value, and if there are any duplicates in 'second' keys, I want to retrieve another one, until all five 'second' keys are unique.
foreach my $k (keys %{$data[$i]}) { #5 keys my ($key, $val) = retrieve_kv($hash{$k}); ### CHECK IF UNIQUE - push to array and sort? ### REDO my ($key, $val) = retrieve_kv($hash{$k}) ### UNTIL ALL 5 ARE UNIQUE }
Any tips on how to structure the inner loop efficiently?
In reply to Until loop / unique by monkini
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |