- or download this
my %seen =() ;
@unique_array = grep { ! $seen{$_}++ } @non_unique_array ;
- or download this
sub dedup {
my %seen;
grep { ! $seen{$_}++ } @_;
}
- or download this
@tapes = qw(tape1 tape2 tape1 tape3 tape2 tape1);
print join(' ',dedup(@tapes)),"\n";