TieUpYourCamel has asked for the wisdom of the Perl Monks concerning the following question:
The only thing I can find that does anything close to this is Devel::Size, but it gives the total amount of memory used by the hash, which is interesting, but not what I want:{ 'key' => 'value' } #should be 7
Is there a package that will do what I want?use strict; use warnings; use Devel::Size('total_size'); use feature 'say'; my $testme = { 'key' => 'value' }; say total_size($testme); # Output is "223"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Get total number of characters in a hash (not memory usage)
by haukex (Archbishop) on Jan 28, 2020 at 20:54 UTC | |
|
Re: Get total number of characters in a hash (not memory usage)
by davido (Cardinal) on Jan 28, 2020 at 21:43 UTC | |
|
Re: Get total number of characters in a hash (not memory usage)
by choroba (Cardinal) on Jan 28, 2020 at 21:38 UTC | |
|
Re: Get total number of characters in a hash (not memory usage)
by gurung (Sexton) on Jan 29, 2020 at 11:41 UTC | |
|
Re: Get total number of characters in a hash (not memory usage)
by TieUpYourCamel (Scribe) on Jan 29, 2020 at 15:44 UTC | |
by tybalt89 (Monsignor) on Jan 29, 2020 at 18:20 UTC |