http://qs1969.pair.com?node_id=641488


in reply to Strings and numbers: losing memory and mind.

Interesting post ... it prompted me to run the following:
use warnings; use Devel::Size qw(size); $str = "123"; $str += 0; # numify $str $num = int("123"); print size($str), " ", size($num), "\n";
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 ?

Cheers,
Rob