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;