PerlApp-generated-exe can't Load packages

651 views Asked by At

PerlApp generate perl script to executable. I get a problem using the PerlApp Here are the steps:

  1. Generate a perl script (e.pl) with the following 2 lines require Date::Manip; require Date::Manip::DM6;
  2. perlapp e.pl --add Date::Manip --add Date::Manip::DM6
  3. e.exe generate the following errors: c:_test>e.exe ERROR LOADING MODULE: Date::Manip::DM6 at /Date/Manip.pm line 35.
2

There are 2 answers

1
Miller On

Just in case you're suffering from an XY Problem:

Considering using pp instead of PerlApp. The following works just fine:

use strict;
use warnings;

use Date::Manip;

print "Hello World\n";

And then packaging:

pp hello_date.pl
0
stevenl On

You need to add more than just Date::Manip::DM6:

perlapp --add Date::Manip::** e.pl

The wildcards indicate that all submodules in the Date::Manip namespace should be added, including some that are more than 1 level down. The error is because DM6 depends on these other submodules, some of which seem to be implicit.

Also you don't need to require Date::Manip::DM6 as that is not how you're meant to use the module. Version 6 is used automatically depending on your version of perl, which gets included in your compiled exe.