package A::B; sub meth { warn "meth $_[0]"; } my $meth='meth'; A::B->$meth(25); # succeeds... A::B::$meth(25); # fails...
I know that $_[0] contains different things due to the use of the arrow over colons. But I would like to know why I cannot call a class subroutine whose name is specified via a scalar.
In reply to Calling a class method name in a scalar using :: syntax by metaperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |