in reply to Optimizing Memory consumption

I am considering using a central scalar with an integer value that can be accessed as a bitfield
In that case, you may find vec useful.

In perl 5.8.x on a 32-bit platform, a scalar holding an integer will typically use 16 bytes; a float 20; a string 28 + length of string; an array 52; an array slot 4; a hash 60; a hash slot (24 to 48) + length of key.

Dave.