Perl Programming/Keywords/length
Appearance
The length
keyword
[edit | edit source]length
is a function that returns how long the following expression is in terms of characters. If no EXPRESSION
is given, it returns the length of $_
. If the expression is undefined, undef
is returned.
As length returns the number of logical characters, to find out the number of bytes in UTF-8, one has to enter an expression (see below).
Syntax
[edit | edit source] length EXPRESSION