Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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]
[karlgoethebier]: holli: Red Coke? It's called "Korea" - cheap red wine wine coke :-(
[choroba]: we call it "mushroom" here
[karlgoethebier]: had his first oysters this year for lunch - with some really white wine. Great
[karlgoethebier]: choroba: this drink makes blind...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (10)
As of 2017-09-25 13:44 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (280 votes). Check out past polls.