use strict; use warnings; my $words = < $freq{$a}} keys %freq; #### on: 5 to: 5 a: 5 each: 3 i: 3 file: 2 of: 2 would: 2 in: 2 be: 2 want: 1 which: 1 files: 1 thanks: 1 that: 1 keywords: 1 i'd: 1 eventually: 1 mostly: 1