![]() |
|
XP is just a number | |
PerlMonks |
Re^2: Test if a string is a sub nameby BillKSmith (Monsignor) |
on Oct 06, 2022 at 15:15 UTC ( #11147273=note: print w/replies, xml ) | Need Help?? |
I do not understand how your expression &$string works. The documentation for exists tells us that the expression must return the name of a subroutine. It appears to me that this would only be true for your expression if $string is a symbolic reference (which is prohibited by use strict). I would expect you need string interpolation (perhaps "&$string") but this syntax throws an error that the argument of exists is not a subroutine.
Bill
In Section
Seekers of Perl Wisdom
|
|