in reply to Get only unique values into array

You can do this way:
my %h = map { $_, 1 } @arr; my @uniq_arr = keys %h;
or module List::MoreUtils can be used.