in reply to Remove duplicate strings from an array
The keys of a hash are always unique, so you just have to reconstruct the list of keys at the end:
use strict; use warnings; my @array = ("abc","def","abc","ghi","ghi","abc","jklm","abc","def"); my %hash = map { $_ => 1 } @array; my @unique = keys %hash;
|
|---|