in reply to OO-call bug uncovered & autovivified functions: defined? exists?
exists can indeed be used on subs; go back and reread the documentation. It takes the form exists &foo or exists &{foo}, where foo is the name of a sub (sans sigil) or a simple scalar variable containing a code reference or (2nd form only) an arbitrary expression yielding a code reference.
Update: just read through your code example. IMO there are no bugs there; you are created an undefined sub KA::boom. Such a sub takes precedence over a parent's boom. This can be useful in the case of a class using AUTOLOAD:
package Parent; sub boom { die "please don't call me" } package Child; sub boom; # exists but not defined, same as your \&boom but created at + compile time sub DESTROY {} sub AUTOLOAD { die "call me instead" } package main; bless({},"Child")->boom
|
|---|