in reply to punctuation search (different!)

Yes, a hash is probably your solution. If you create a hash that looks like this:

%charnames = ( '?' => 'question mark', '.' => 'fullstop', ',' => 'comma', # and so on );

Then printing out the results would be as simple as this:

print ("$charnames{$punctuation}\t$count\n");

Dave