$string = "This is a test\nMore Test"; $len++ for ($string =~ /./sg); print $len;