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

Thank you dasgar. I did wonder whether other options where a possibility. I had a good read of the man pp page in order to figure out possible necessary options, but from reading, it started to talk about PAR aswell, and i'm not entirley sure on the difference of a .PAR or .out?

My understanding was that using pp in its naked form should include all libraries and modules etc. by smart reading the 'includes/use' of the script, and in honesty, the only module I see being a problem is the Digest::MD5 qw(md5_hex) which I use for simple encryption (just keeps the QA team away from the gears and cogs ;) )

Replies are listed 'Best First'.
Re^3: Help with pp - Perl Packer
by dasgar (Priest) on Jan 29, 2015 at 16:57 UTC

    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.

      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?