Help for this page

Select Code to Download


  1. or download this
    my $s = "#tag1 #tag2 #tag3 #tag1";
    
    ...
    map { ++$x->{$_}; $d->{$_}=$x->{$_} if $x->{$_} > 1 } split /\s+/, $s;
    printf qq{Uniq: %s\n}, join(' ', sort keys %$x);
    printf qq{Dupes found for: %s\n}, join(', ', sort keys %$d);
    
  2. or download this
    Original: #tag1 #tag2 #tag3 #tag1
    Uniq: #tag1 #tag2 #tag3
    Dupes found for: #tag1