From the viewpoint of Perl 5, it's a feature, but from the viewpoint of Perl 6, it's a bug. Perl 6 will distinguish AUTOMETH from AUTOSUB. (Those are the declarative forms, which return references. Perl 6 will distinguish those from the defining forms, which are spelled AUTOMETHDEF and AUTOSUBDEF, and which may only be called on predeclared (or autodeclared) names to supply a missing definition.)
Re: •Re: Detecting function vs method in an AUTOLOAD?
Select or Download Code Replies are listed 'Best First'.
Yes, once you've taken a reference to a method, it's essentially a sub ref at that point, so the Perl 6 equivalent of your code works as you'd expect. In fact, the standard dispatchers are defined in those terms. But the standard dispatchers will be able to keep subs and methods straight to the extent that you wish them to (which, by default, is up to the point that a method turns out to be completely missing, and you wish it to "failover" to looking for a multi-sub instead).