Personally, I like List::Compare:
in reply to to pick the common element in the array
Also, use strict; and use warnings; caught the typos you made in defining the arrays.
my $lc = List::Compare->new(\@array1, \@array2);
# Get those items which appear at least once in both lists (their inte
my @intersection = $lc->get_intersection;
print Dumper \@intersection;