diff --git a/perl/remove_duplicates.pl b/perl/remove_duplicates.pl new file mode 100644 index 00000000..62406ea2 --- /dev/null +++ b/perl/remove_duplicates.pl @@ -0,0 +1,5 @@ +#!/usr/bin/perl + +my @array = (1,10,7,1,4); +my @unique = keys {map {$_ => 1} @array}; +print @unique;