user3586164
user3586164

Reputation: 195

PerlApp-generated-exe can't Load packages

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.

Upvotes: 2

Views: 658

Answers (2)

stevenl
stevenl

Reputation: 6798

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.

Upvotes: 3

Miller
Miller

Reputation: 35208

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

Upvotes: 1

Related Questions