in reply to Get total number of characters in a hash (not memory usage)
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;
|
|---|