在perl中有多种的表示继承的形式,这里说的是rt的两个表示继承的关键词base和parent。

是的,两者都是表示继承的关系,并且是同时加载父类module,那么两者又有怎样的区别那,

如果继承的父类又继承于其他的父类,同时这两个package是在同一个文件里的,只有使用parent关键词了


另外,当base tires to require a module,it will not die if it cannot find the module's

但是如果父类为空,含有空的符号表的时候,就会die了

 

参考url:http://perldoc.perl.org/parent.html

            http://perldoc.perl.org/base.html

相关文章:

  • 2022-03-10
  • 2021-11-25
  • 2021-12-24
  • 2022-12-23
  • 2021-11-22
  • 2021-11-04
  • 2022-12-23
猜你喜欢
  • 2021-05-24
  • 2021-06-08
  • 2021-06-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-26
相关资源
相似解决方案