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 hashI'm guessing you mean the number of bytes in all the values of a hash, which you could do like so
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).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
_________
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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |