Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re^3: How to create a compact data structure?

by Hofmator (Curate)
on Dec 20, 2006 at 11:57 UTC ( #590893=note: print w/replies, xml ) Need Help??

in reply to Re^2: How to create a compact data structure?
in thread How to create a compact data structure?

I don't know about 'reliable' but 'how' should work like this:
use Devel::Size qw(total_size); # code by perrin my $size_rec_hash = total_size(\%record); my $size_flag_hash = total_size(\%flag); print "Total size: $size_rec_hash + $size_flag_hash =", $size_rec_hash + $size_flag_hash, "\n";
Update: I missed the point, please ignore.

-- Hofmator

Code written by Hofmator and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

Replies are listed 'Best First'.
Re^4: How to create a compact data structure?
by bart (Canon) on Dec 20, 2006 at 12:02 UTC
    You are totally ignoring the fact that these hashes have many keys in common, as every single key in %flag is also a key in %record. And that was precisely the point I was asking about.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://590893]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (6)
As of 2016-10-01 13:49 GMT
Find Nodes?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:

    Results (577 votes). Check out past polls.