=over

=item length EXPR
X<length> X<size>

=item length

Returns the length in I<characters> of the value of EXPR.  If EXPR is
omitted, returns the length of L<C<$_>|perlvar/$_>.  If EXPR is
undefined, returns L<C<undef>|/undef EXPR>.

This function cannot be used on an entire array or hash to find out how
many elements these have.  For that, use C<scalar @array> and C<scalar keys
%hash>, respectively.

Like all Perl character operations, L<C<length>|/length EXPR> normally
deals in logical
characters, not physical bytes.  For how many bytes a string encoded as
UTF-8 would take up, use C<length(Encode::encode('UTF-8', EXPR))>
(you'll have to C<use Encode> first).  See L<Encode> and L<perlunicode>.

=back