Hello all,
I am having trouble packaging some scripts. I find that some modules
don't get included into the PAR exe.
Consider the following code:
[Begin code]
#!/usr/bin/perl -w
use strict;
use Data::Dumper;
use Graph::Directed;
require Graph::DFS;
my @GUIDs = ([1, 2, 3, 4],[2, 3, 4, 5],[1, 3, 4, 5]);
print Dumper(@GUIDs);
my $graph = Graph::Directed->new();
for (0..$#GUIDs) {
$graph->add_path(@{$GUIDs[$_]});
}
my @GUIDs_ordered = $graph->toposort;
print Dumper(@GUIDs_ordered);
[End code]
When run on its own, it executes fine. When I package it with pp, using
the following command:
pp -o test.exe test.pl
... the resulting executable returns this error when run:
Can't locate object method "postorder" via package "Graph::DFS" at
Graph/Base.pm line 1629.
Then, I tried adding the module, like this:
pp -M Graph::DFS -o test.exe test.pl
... but, the executable returns this error when run:
Can't locate Graph/DFS.pm in @INC (@INC contains: CODE(0xb9780c)
CODE(0xc8a5fc) .) at Graph/Base.pm line 1603.
BEGIN failed--compilation aborted at Graph/Base.pm line 1603.
Compilation failed in require at Graph/Directed.pm line 6.
BEGIN failed--compilation aborted at Graph/Directed.pm line 6.
Compilation failed in require at script/test.pl line 5.
BEGIN failed--compilation aborted at script/test.pl line 5.
Examining the contents of the exe, I find that the DFS.pm module is not
in there.
The problem is, Graph::DFS is needed by Graph::Directed, but I don't
ever call it directly. I am having the same problems when I use
XML::Simple... it returns errors with XML::Parser.
Am I doing something wrong here? Is there a way around this?
Thanks for your help,
Clay.