- or download this
$string = "This is a test\nMore Test";
$len++ for ($string =~ /./sg);
print $len;
- or download this
$_ = "This is a test\nMore Test";
$len = (split //);
print $len;
- or download this
$string = "This is a test\nMore Test";
$len = (grep /./s, (@chars = split //, $string));