更新时间:2023-10-22 23:13:16
在 Perl 中有多种声明方法的方法.这是一个几乎可以肯定不完整的列表:
There are a number of ways to declare a method in Perl. Here is an almost certainly incomplete list:
sub NAME { ... }
method NAME (...) {...}
*NAME = sub {...};
另外,如果包声明了一个AUTOLOAD
函数,那么可能没有对该方法的显式定义.有关详细信息,请参阅 perlsub.
In addition, if the package declares an AUTOLOAD
function, then there may be no explicit definition of the method. See perlsub for more information.