Help for this page
Select Code to Download
Select
or
download this
my $cnt = $str =~ tr/1//;
Select
or
download this
my %char_cnt; ++$char_cnt{$_} for split //, $str;