I didn't think that strictures or local versus global variables had, or could have any bearing on the matter. And in the great scheme of things it doesn't--other than the secondary diagnostic message.
However, I think that your observation that the second part of the error message (not scalar dereference) (which I think is new from 5.10.0) is misleading, if not just plain wrong. In that what I was passing was a scalar containing a reference (to some code), not a dereference.
But having seen the difference in the message you've received when the scalar containing the reference is a lexical, it suggests (perhaps), that the presence of the & prototype modifies what the code producing the message sees in some way.
That is mildly confusing, but not hugely significant. As the messages identifying the source of the error are relatively new, perhaps they'll get honed as time goes on.
In reply to Re^2: The & prototype and code references in scalars.
by BrowserUk
in thread The & prototype and code references in scalars.
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |