sub E; # exists, but not defined sub D { 1 }; # exists _and_ defined # sub N does _not_ exist $\="\n"; print exists(&N) ? "N exists" : "N doesn't exist"; print exists(&E) ? "E exists" : "E doesn't exist"; print exists(&D) ? "D exists" : "D doesn't exist"; print defined(&N) ? "N is defined" : "N is not defined"; print defined(&E) ? "E is defined" : "E is not defined"; print defined(&D) ? "D is defined" : "D is not defined"; __END__ N doesn't exist E exists D exists N is not defined E is not defined D is defined