You are viewing the version of this documentation from Perl 5.7.1. This is a development version of Perl.
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.