in reply to Strings and numbers: losing memory and mind.
Interesting post ... it prompted me to run the following:
Cheers,
Rob
On Win32 that outputs 32 16 (56 24 on a 64-bit build of perl). I guess that's a reliable way of determining the memory consumed by both $str (32 bytes) and $num (16 bytes). Zat right ?use warnings; use Devel::Size qw(size); $str = "123"; $str += 0; # numify $str $num = int("123"); print size($str), " ", size($num), "\n";
Cheers,
Rob
|
---|
In Section
Meditations