Hello
manbroski, welcome to the Monastery!
Prototypes are seldom used in Perl.
It is usually enough to pass a reference as the argument directly:
sort_and_print_hash_keys(\%letters);
Moreover, counting characters in a string is idiomatically done via the
tr operator. We know in advance that the possible characters are A, C, T and G only, so you can write:
#!/usr/bin/perl
use strict;
use warnings;
use feature qw(say);
my $s = shift;
say join " ", map eval "$s =~ tr/$_//", qw/A C G T/;
Which was exactly my solution to the DNA problem on Rosalind :-)