, welcome to the Monastery!
Prototypes are seldom used in Perl.
It is usually enough to pass a reference as the argument directly:
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:
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 :-)