That gives the number of characters in $scalar, which may or may not also be the number of bytes (depending on the encoding (ASCII? UTF-8? Full Unicode?) and probably a bunch of other things I don't even know about). To get the number of bytes (as the OP asked), you need to use bytes; before calling length.
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
In reply to Re: Re: Size of scalar in bytes
by hardburn
in thread Size of scalar in bytes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |