while ( my ($punctuation, $count) = each(%wordHash) ) { push @wordArray, "$count\t$punctuation" print ("$count\t$charnames{$punctuation}\n"); }