http://www.perlmonks.org?node_id=647756


in reply to Re: OO-call bug uncovered & autovivified functions: defined? exists?
in thread OO-call bug uncovered & autovivified functions: defined? exists?

I don't think it makes semantic sense for exists to be applied to functions.

Nonetheless there are semantics for it.

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

print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!