Help for this page

Select Code to Download


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