jeffthewookiee has asked for the wisdom of the Perl Monks concerning the following question:

I'm working on a pretty memory intensive Perl script, using a lot of nested hashrefs and arrayrefs. I need to be able to compare the size of different data structures. Is there anything like a C sizeof operator for Perl that I can use to estimate memory usage?

Replies are listed 'Best First'.
Re: Perl sizeof Equivalent
by moritz (Cardinal) on May 28, 2008 at 19:22 UTC
Re: Perl sizeof Equivalent
by dragonchild (Archbishop) on May 28, 2008 at 19:21 UTC
    Others will give you the answer you're looking for. I'm here to recommend using DBM::Deep for some of these structures.

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?