in reply to Re^2: Help with pp - Perl Packer
in thread Help with pp - Perl Packer

Let's take the example code below:

use strict; use warnings; use Digest::MD5;

Let's say that was in a file named script.pl. If we run pp -o program.exe script.pl, pp would package in the Digest::MD5 module. But if you look at the Digest::MD5 module, it uses the Digest::Base module. Since the code above does not explicitly list Digest::Base, pp doesn't know that it needs to grab it.

That's where the -x and -c options come into play. They tell pp to run the script to pickup any additional run-time dependencies. In this case, by running pp -c -x -o program.exe script.pl, pp will discover that Digest::MD5 needs Digest::Base and will then add in Digest::Base. There are times pp will still miss required modules. In those cases, you can use the -M option to explicitly add in those modules.

This is just a super simple example that I came up with to help explain what the -c and -x options do. Others could perhaps give a better and/or more detailed explanation, but I'm hoping this helps you better understand those two options do.

Replies are listed 'Best First'.
Re^4: Help with pp - Perl Packer
by perloHolic() (Beadle) on Jan 29, 2015 at 17:08 UTC

    That is a fantastic example, thank you. Sadly I did try this and although it printed some extra info to STDOUT while creating the executable, this didn't seem to have any effect on its success i'm afraid.

    One point that I should mention at this point is that there is a txt file that the script looks at with the stored usernames and encrytped passwords. - should this be in the executable or not? (pardon my ignorance) I'm not sure thats actually having any adverse affect on it yet as so far I have left that file out of the executable and the executable still reads from the file ok and allows access to the main menu, presumably because the file is in the same directory as the executable?