Home >> perlfunctions >>Perl function: lengthSyntax:length STR lengthReturns the number of characters in the string, STR. If STR is missing, value stored in $_ will be used. Example: my $str = "Test String"; my $str_len = length($str); print "Length of $str is $str_len";Output: Length of Test String is 11It's a good practice to put STR in parenthesis to avoid confusion. The function length works only on strings. It won't work on arrays or hash. Perl functions
|
List of all perl functions Perl function : split Perl function: abs Perl function: chomp Perl function: chop Perl function: chr Perl function: crypt Perl function: eval Perl function: hex Perl function: lc Perl function: lcfirst Perl function: oct Perl function: ord Perl function: shift
|