$ perl -wle'my %a; print defined(%a)?1:0' defined(%hash) is deprecated at -e line 1. (Maybe you should just omit the defined()?) 0