你为什么要放1?在Perl 5模块的末尾?

前端之家收集整理的这篇文章主要介绍了你为什么要放1?在Perl 5模块的末尾?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
为什么所有Perl 5模块都要以1;?结束?

解决方法

A Perl module must end with a true value or else it is considered not to
have loaded. By convention this value is usually 1 though it can be
any true value. A module can end with false to indicate failure but
this is rarely used and it would instead die() (exit with an error).

来源:wiki

原文链接:https://www.f2er.com/Perl/172943.html

猜你在找的Perl相关文章