in reply to Remove duplicate strings from an array

This is similar to liverpole's solution but populates the hash using a hash slice rather than a map. Also, you seem to want the resultant array sorted so I've done that.

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