perl – 如何检测程序是否在PAR存档中运行?

前端之家收集整理的这篇文章主要介绍了perl – 如何检测程序是否在PAR存档中运行?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在研究一个与 PAR捆绑在一起的大型Perl应用程序,以及一堆支持文件.

当应用程序在PAR中运行时,我可以使用PAR :: read_file来获取存档中的这些各种文件.但是,在我开发的过程中,我不想每次调整一些代码时都必须对整个应用程序进行重新PAR.

有没有办法告诉我脚本是否在PAR内运行,所以我可以选择从PAR存档或常规文件系统加载文件

解决方法

PAR::Environment可能提供一些线索:

PAR uses varIoUs environment variables both during the building process of executables or PAR archives and the use of them.

PAR_0

If the running program is run from within a PAR archive or pp-produced executable,this variable contains the name of the extracted program (i.e. .pl file).

猜你在找的Perl相关文章