use strict; use warnings; my %hash; print "$^V\n"; print "Empty: !\%hash\n" if !%hash; print "Empty: ! scalar\n" if ! scalar %hash; print "Empty: 0 == scalar\n" if 0 == scalar %hash; print "Empty: ! keys\n" if ! keys %hash; ++$hash{entry}; print "Not empty: \%hash\n" if %hash; print "Not empty: scalar\n" if scalar %hash; print "Not empty: 0 != scalar\n" if 0 != scalar %hash; print "Not empty: keys\n" if keys %hash; #### v5.32.1 Empty: !%hash Empty: ! scalar Empty: 0 == scalar Empty: ! keys Not empty: %hash Not empty: scalar Not empty: 0 != scalar Not empty: keys