Help for this page

Select Code to Download


  1. or download this
    my @string = qw(a a a a b b b c d e f q q q r r r);
    my @singletons = uniq(@string);
    
  2. or download this
    uniq LIST
    Returns a new list by stripping duplicate values in
    ...
    number of unique elements in LIST.
    
    my @x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 1 2 3 5 4