Help for this page

Select Code to Download


  1. or download this
    # code to mimic uniq(1)
    
  2. or download this
    # mode: divine
    my @result = do {
      my %counter;
      grep ++$counter{$_} == 2, @input;
    };
    
  3. or download this
    # mode: tired
    for (@input) {
    ...
    for keys( %multiples ) { 
      print "$_\n" if (--$multiples{$_});
    }