use strict; my $hash = undef; print "shouldn't print\n" if $hash; # prints nothing print 1 if $hash->{1}; # should be a no-op, but it makes $hash to be {} print "Still shouldn't print, but it does.\n" if $hash; # prints