- or download this
this is a test => 2
is a test => 2
a test => 1
- or download this
sub count_unique {
# extract unique elements of array and count occurrences
...
return %count;
}
- or download this
sub hashValueDescendingNum {
# sort hash by key length in descending order
length($a) <=> length($b)
}
- or download this
this is a test => 2
is a test => 2
a test => 1