in reply to confused with strings
If there is just one A and one D, you can simply use the index function to find the indices of the characters in the string.
Perl --((8:>*
|
---|
In Section
Seekers of Perl Wisdom