in reply to Hash entries starting with a given string.
my %freq = ( aa => { a => 5, b => 2, c => 8, ... }, ab => { ... }, );
You can then get all two letter prefixes with a simple hash access. If you want to access one-letter prefixes as well, nest beginning from the first level instead.
|
|---|