my $sentence="to baah or not to chomp, that's the question"; my $garbage = 0; $garbage++ while ($sentence =~ /[,'\s]/g); @chars = split //, $sentence; print "You can create ", (scalar(@chars) - $garbage)/4.0," groups of four characters here\n";