in reply to Determination of a subs' invocation from within the sub [RESOLVED]

Not to be flippant, but this smacks of an XY Problem, or at least unnecessarily high levels of cleverness. Why would you need to tell the difference?

Assuming you have a Good Reason™, one difference is prototype checking. From perlsub:

Not only does the & form make the argument list optional, it also disables any prototype checking on arguments you do provide. This is partly for historical reasons, and partly for having a convenient way to cheat if you know what you're doing. See Prototypes below.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.

  • Comment on Re: Determination of a subs' invocation from within the sub