my @array1 = qw(perl monks camel); my @array2 = qw(node thread monks); my %hash; for (@array1, @array2) { $hash{$_}++; }