从技术上讲,perldocs 声明 use base 是“不鼓励”而不是正式弃用,这意味着它肯定不会很快消失。但如果您知道您的代码面向 Perl 5.10,那么使用parent 会更好。
For compatibility with older Perls. use parent was added in 5.10, but DBIx::Class still supports Perl 5.8.
Technically, the perldocs state that use base is "discouraged" rather than formally deprecated, implying that it is certainly not going to go away any time soon. But if you know your code is targeting Perl 5.10, use parent is better.
发布评论
评论(1)
为了与旧版 Perls 兼容。
useparent
是在 5.10 中添加的,但DBIx::Class
仍然支持 Perl 5.8。从技术上讲,perldocs 声明
use base
是“不鼓励”而不是正式弃用,这意味着它肯定不会很快消失。但如果您知道您的代码面向 Perl 5.10,那么使用parent
会更好。For compatibility with older Perls.
use parent
was added in 5.10, butDBIx::Class
still supports Perl 5.8.Technically, the perldocs state that
use base
is "discouraged" rather than formally deprecated, implying that it is certainly not going to go away any time soon. But if you know your code is targeting Perl 5.10,use parent
is better.