What is the Perl equivalent of strlen()?
What is the Perl equivalent of strlen() ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
length($string)perldoc -f length length EXPR length Returns the length in characters of the value of EXPR. If EXPR is omitted, returns length of $_. Note that this cannot be used on an entire array or hash to find out how many elements these have. For that, use 'scalar @array' and 'scalar keys %hash' respectively. Note the characters: if the EXPR is in Unicode, you will get the num- ber of characters, not the number of bytes. To get the length in bytes, use 'do { use bytes; length(EXPR) }', see bytes.