How to determine if a program works in the PAR archive?

I am working on a large Perl application that comes bundled with PAR along with a bunch of support files.

When the application is running in PAR, I can use PAR::read_file to access these various files inside the archive. However, while I am developing, I do not want to re-configure the entire application each time, each time I configure the code.

Is there a way to find out if the script works inside PAR or not at runtime, so I can choose to download the file from the PAR archive or regular file system?

+4
source share
1 answer

PAR :: Environment can probably offer some hints:

PAR uses various environment variables during the process of creating executable files and in the archives of PAR and uses it .

...

PAR_0

If the running program is launched from the PAR archive or the executable using pp, this variable contains the name of the extracted program (i.e. the .pl file).

+8
source

All Articles