Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^7: pp can't pack MongoDB and Inline Module

by marto (Chancellor)
on Sep 20, 2012 at 12:41 UTC ( #994647=note: print w/ replies, xml ) Need Help??


in reply to Re^6: pp can't pack MongoDB and Inline Module
in thread pp can't pack MongoDB and Inline Module

It seems Params::Validate::XS isn't being detected, and so not packaged. Can you please show how you called pp to create this executable? Could you try again specifically including this module via the -M option? Thanks.

Update:

Actually, perhaps a better idea would be to extract the executable you've created, as you would a normal zip file, that way you can examine exactly what has been packaged. In future it may be wise to run pp with some logging such (-v, -vv) and redirect that to a file for reference. I appreciate that packaging this module is time consuming but such logs may prove helpful when debugging problems.


Comment on Re^7: pp can't pack MongoDB and Inline Module
Re^8: pp can't pack MongoDB and Inline Module
by Alle (Novice) on Sep 21, 2012 at 06:32 UTC

    It's my complete content.

    Because use pp packing my script is so slowly, so i use perlapp

    my script mongo.pl:

    #!/usr/bin/perl -w use strict; use MongoDB; use MongoDB::Connection; use MongoDB::Database; # mongodb my $conn = MongoDB::Connection->new(host => '127.0.0.1:27017', + query_timeout => 1000 * 6000); my $db = $conn->ygzj_dev; print "$db";

    Use "perl mongo.pl" it print "MongoDB::Database=HASH(0x33b2e8)", It worked fun.

    when I use perlapp compiling it to exe,My command is "perlapp --shared public --norunlib --gui --verbose --warnings --exe mongo.exe mongo.pl", perlapp generate a mongo.exe and there have 5 warnings ,the warnings is:

    <1> Devel\GlobalDestruction.pm: warn: auto\Devel\GlobalDestruction\GlobalDestruction.dll not found refby: C:\Perl64\lib\Moose\Meta\Role.pm line 16 refby: C:\Perl64\lib\Moose\Object.pm line 14 refby: C:\Perl64\lib\Moose\Meta\Method\Destructor.pm line 13 refby: C:\Perl64\lib\Class\MOP\Package.pm line 15 file: C:\Perl64\lib\Devel\GlobalDestruction.pm .... .... <2> Mouse\Util.pm: warn: auto\Mouse\Util\Util.dll not found refby: C:\Perl64\site\lib\Mouse.pm line 11 refby: C:\Perl64\site\lib\Mouse\Meta\Attribute.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Class.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Module.pm line 2 refby: C:\Perl64\site\lib\Mouse\Util\TypeConstraints.pm line 2 refby: C:\Perl64\site\lib\Mouse\Object.pm line 2 refby: C:\Perl64\site\lib\Mouse\Exporter.pm line 17 refby: C:\Perl64\site\lib\Mouse\Meta\Role.pm line 2 refby: C:\Perl64\site\lib\Mouse\PurePerl.pm line 11 refby: C:\Perl64\site\lib\Mouse\Meta\TypeConstraint.pm line 2 refby: C:\Perl64\site\lib\Mouse\Util\MetaRole.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Role\Composite.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Role\Application.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Method\Destructor.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Method\Constructor.pm line 2 refby: C:\Perl64\site\lib\Mouse\Meta\Method\Accessor.pm line 2 file: C:\Perl64\site\lib\Mouse\Util.p .... .... <3> Perl\Tidy.pm: warn: Can't locate Perl\Tidy.pm refby: C:\Perl64\lib\Eval\Closure.pm line 151 ... ... <4> SetDualVar.pm: warn: Can't locate SetDualVar.pm refby: C:\Perl64\lib\Win32\TieRegistry.pm line 39 ... ... <5> VMS\Feature.pm: warn: Can't locate VMS\Feature.pm refby: C:\Perl64\lib\Cwd.pm line 211

    I have already installed Mouse, Devel-GlobalDestruction, VMS-FileUtils..., I think these all warning msg is not important, Because when I compiled other script also had some warnings. When I executed the mongo.exe file,there have run error, error msg:

    {.\mongo.exe} Could not find a suitable Params::Validate implementation: Can't locat +e Params/Validate/XS.pm in @INC (@INC contains:) at /<C:\Users\Admini +strator\Desktop\tmp\mongo.exe>Module/Runtime.pm line 317. Can't locate Params/Validate/PP.pm in @INC (@INC contains:) at /<C:\Us +ers\Administrator\Desktop\tmp\mongo.exe>Module/Runtime.pm line 317. at /<C:\Users\Administrator\Desktop\tmp\mongo.exe>Params/Validate.pm +line 66. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>DateTime/Duration.pm line 12. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>DateTime.pm line 43. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>MongoDB/GridFS.pm line 24. BEGIN failed--compilation aborted at /<C:\Users\Administrator\Desktop\ +tmp\mongo.exe>MongoDB/Database.pm line 23. BEGIN failed--compilation aborted at mongo.pl line 5.

    I have allready installed "Params-Validate Validate method/function parameters", Can I compile the script to exe file with could execute. You can test it. my os is windows7 64 bit, my perl is 5.16(active state perl), Thank you very much!

        I test, Use:

        perlapp --add Mouse:: --add Devel:: --add VMS:: --add SetDualVar --sha +red public --norunlib --gui --verbose --warnings --exe mongo.exe mon +go.pl

        gen mongo.exe, run Failure! Same error! Can you test it and give me help again! thank you!

      Hi, I don't have perlapp, so I can't help you with that aspect. It looks as though these modules aren't being packaged. Consider taking my previous advice, unpack the executable to determine what has been packaged. When I package your script using pp as previously described, the executable works without error, though it took quite some time (over half an hour) to package.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://994647]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (19)
As of 2014-09-17 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (79 votes), past polls