in reply to Remove duplicate strings from an array
use strict; use warnings; use Data::Dumper; my @array = qw{abc def abc ghi ghi abc jklm abc def}; my %comb; @comb{@array} = (); my @uniq = sort keys %comb; print Data::Dumper->Dumpxs([\@uniq], [qw{*uniq}]);
The output is
@uniq = ( 'abc', 'def', 'ghi', 'jklm' );
I hope this is of use.
Cheers,
JohnGG
|
|---|