in reply to Get total number of characters in a hash (not memory usage)

> should be 7

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;
map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]