use Tie::IxHash;
tie my %unique => 'Tie::IxHash';
my @duplicates = (1, 1, 2, 3, 4, 5, 5, 6, 7, 7, 8, 9, 2, 3, 3,);
@unique{@duplicates} = ();
my @unique_elements = keys %unique;
print "@unique_elements\n";
tie my %unique => 'Tie::IxHash';
my @duplicates = (1, 1, 2, 3, 4, 5, 5, 6, 7, 7, 8, 9, 2, 3, 3,);
@unique{@duplicates} = ();
my @unique_elements = keys %unique;
print "@unique_elements\n";
No comments:
Post a Comment