For example if I have this array:
array={"a","b","c","d","a","d","b","d","z"}
I want to split it to arrays that involves the same elements by Perl.
The output should be like this:
array1={"a","a"}
array2={"b","b"}
array3={"c"}
array4={"d","d","d"}
array5={"z"}