in reply to Counting number of characters in a string

my $len = map $_, $str =~ /(.)/gs;