in reply to Re^2: Test if a string is a sub name
in thread Test if a string is a sub name
Use of a subroutine call, rather than a subroutine name, as an argument to exists is an error.exists ⊂ # OK exists &sub(); # Error
So, in this context, "subroutine name" includes the ampersand.
Considering strict, note the exceptions to strict 'refs':
We are not calling the subroutine, we're just checking it exists/is defined.$bar = \&{'foo'}; &$bar;
|
|---|