The length operator can be used to determine the length of a string. In this example, string "Hello World" contains 11 characters (whitespace is a character).
my $string = "Hello World"; my $length = length($string); print "$length\n";