in reply to remove duplicate value in array

another way is to use List::MoreUtils.
use List::MoreUtils qw/uniq/; my @uniq_array = uniq @array;
Boris