perl – 如何在当前块范围内实现导入语义?

前端之家收集整理的这篇文章主要介绍了perl – 如何在当前块范围内实现导入语义?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
使用文件表明:

Some … pseudo-modules import semantics into the current block scope (like strict or integer,unlike ordinary modules,which import symbols into the current package (which are effective through the end of the file).

同样,autodie

Replace functions with ones that succeed or die with lexical scope

如何使用普通模块将导入语义实现到当前块范围?

解决方法

使用一些不包含用户pragma空间的特殊标志变量来实现strict和warnings.从perl 5.10开始,您可以编写自己的词法范围的pragma. perlpragma包含有关如何执行此操作的信息.您还可以浏览现有实用模块的来源.

猜你在找的Perl相关文章