Just wondering if there is a module or something out there in PERL that can be used to get the number of bytes in a hash
I'm guessing you mean the number of bytes in all the values of a hash, which you could do like so
my %hash = qw(foo one bar two baz three); my $hash_len = 0; $hash_len += length for values %hash; print "hash length is $hash_len\n"; __output__ hash length is 11
And make sure you use the bytes pragma if you're working with Unicode (unless you're using 5.8.0 which should deal with it seamlessly).
HTH

_________
broquaint


In reply to Re: Function to measure size of a hash by broquaint
in thread Function to measure size of a hash by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.