in reply to Re: Size of scalar in bytes
in thread Size of scalar in bytes
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Size of scalar in bytes
by Itatsumaki (Friar) on Nov 17, 2003 at 17:54 UTC | |
by hardburn (Abbot) on Nov 17, 2003 at 18:05 UTC | |
by grantm (Parson) on Nov 17, 2003 at 18:06 UTC |