in reply to Remove duplicate strings from an array

A really quick way to do it is to create a hash, using the elements of the array as keys.

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;

s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/