#!/usr/bin/perl -w use strict; my $string = q; my %count; for (split(//, $string)){$count{$_}++;} print(q, $count{A}, "\n");