Really? Like this?
#!/usr/bin/perl use warnings; use strict; use feature qw{ say }; my $hash = { 'key' => 'value' }; my %chars; $chars{$_} ++ for split //, join "", %$hash; my $count = keys %chars; say $count;
In reply to Re: Get total number of characters in a hash (not memory usage)
by choroba
in thread Get total number of characters in a hash (not memory usage)
by TieUpYourCamel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |