in reply to Creating Frequency Matrix

What have you tried so far?

For starters, perlfaq4 and perlfaq5 contain examples of how to count substrings/characters, and perllol introduces you to arrays of arrays, which you'll probably need to create a matrix.