For this, you'd need to learn a little perlxs. It is probably very easy to use Inline to hook yourself up with sizeof() and some SV function to pull this info. Perl alone provides no such mechanism unless you consider Data::Dumper to give you a rough estimate of data in the structure (it will not tell you how much memory Perl allocates along with it). Good luck!