Thanks Ron,

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.

I'll keep it in mind as I try the explicit approach.

Regards,
Shawn.



On 17/12/2014 2:39, Ron W wrote:
On Tue, Dec 16, 2014 at 6:16 AM, Shawn Laffan <shawn.laf...@unsw.edu.au <mailto:shawn.laf...@unsw.edu.au>> wrote:

    What I'm thinking of is some way for a PAR executable to detect if
    extra files packed using -a are missing, and then unpack them.


I just had a thought for a work-around.

When pp script.pl <http://script.pl> is run, the script is "statically scanned" for dependencies.

When pp -c script.pl <http://script.pl> is run, after the static scan, the script is compiled (like perl -c script.pl <http://script.pl>). I am thinking that %INC is then inspected for additional libraries.

So, my idea is, after identifying all the extra files to be included with -a, go back to the main .pl file and add a BEGIN block that adds those library names to %INC. Then run "pp -c main.pl <http://main.pl>" - without any -a options - then verify the created executable runs correctly.

As I said, I see this as a work-around.

A better solution would be for pp to save the names of all the files included via -a just as it saves the ones it detects.


--
Assoc Prof Shawn Laffan
  School of Biological, Earth and Environmental Sciences
  UNSW, Sydney 2052, Australia
  Tel +61 2 9385 8093   Fax +61 2 9385 1558
  http://www.bees.unsw.edu.au/staff/shawn-laffan
  http://www.purl.org/biodiverse (free diversity analysis software)
  http://www.tandf.co.uk/journals/ijgis

  UNSW CRICOS Provider Code 00098G

Reply via email to