use
的文档表明:
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
如何用普通模块实现导入语义到当前 block 作用域?
最佳答案
strict
和 warnings
是使用一些不包含用户编译指示空间的特殊标志变量来实现的。从 perl 5.10 开始,您可以编写自己的词法作用域编译指示。 perlpragma包含有关如何执行此操作的信息。您还可以浏览现有实用模块的源码。
关于perl - 如何将导入语义实现到当前 block 范围?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5175060/