On 17/12/2014 7:50, Ron W wrote:
On Tue, Dec 16, 2014 at 3:29 PM, Shawn Laffan <shawn.laf...@unsw.edu.au <mailto:shawn.laf...@unsw.edu.au>> wrote:

    The issue is that these files are usually not additional
    libraries.  They are typically extra files for icons, config,
    data, and the like.  That said, they don't tend to have .pm or .pl
    extensions so maybe this could work.


Yes, I've had to use -a for icons, config files, etc. The new thing (to me) is the partial removal of cached files.

It just occurred to me that %INC was the obvious variable that would get updated by "perl -c script.pl <http://script.pl>". Of course, pp's scanner could be adding its own "instrumentation", but if that's the case, should not be too hard to see how that works. And then determine if a BEGIN block in the script being "scanned" can safely insert additional files.

I did do an experiment. I added a BEGIN block to an existing script to add an arbitrary file to %INC. As best I can determine, Perl did not care. The script ran normally, including all the modules it uses.

I will experiment more. If this does work, then the script will contain the list of other resources used both for generating the executable and for re-extracting when necessary, at run time.


PAR does add itself to @INC at run time (see example below), so maybe adding a packed data folder to %INC, or the end of @INC to avoid name clashes, in a BEGIN block the script would be a viable workaround. Please do post the results.

(BTW, your replies aren't going to the list).


@INC when running a par exe:
C:\user\svn\bd_releases\biodiverse_0.99_007_win64\lib CODE(0x3289f10) C:\Users\user\AppData\Local\Temp\par-736861776e\cache-b078428bc6c4b872664f757140eea943a5fb10a3\inc\lib C:\Users\user\AppData\Local\Temp\par-736861776e\cache-b078428bc6c4b872664f757140eea943a5fb10a3\inc CODE(0x2f57670) CODE(0x2f57bc8)

Regards,
Shawn.




Reply via email to