http://www.perlmonks.org?node_id=466856


in reply to Testing Hash with empty value in HoH

A reference to a hash, even an empty hash, is true. Try defreferencing it.

my $foo = {}; print "OK\n" if (scalar %{$foo});