使用文件表明:
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包含有关如何执行此操作的信息.您还可以浏览现有实用模块的来源.