Help for this page

Select Code to Download


  1. or download this
    use List::Util qw( uniq );
    
  2. or download this
    sub uniq {
        my @values = @_;
    ...
        @uniq{@values} = ();
        return keys %uniq
    }
    
  3. or download this
    sub uniq {
        my @values = @_;
        my %seen;
        return grep ! $seen{$_}++, @values
    }