in reply to Re^3: PAR::Packer pp command including too many modules
in thread PAR::Packer pp command including too many modules

Yes, but if pp -e "print 1..99" doesn't include them, I see no reason why pp -e "use strict" should. The purpose of PAR::Packer is to only include the modules needed by the particular perl program you are packing, not your entire build tree. Or so I thought.

Based on your hint about scandeps, I tried it from the command line (though I'm not sure it would be doing the exact same thing as what pp uses it for) and it behaves similarly, but give some error messages about not being able to connect to CPAN sites to download stuff:

C:\strawberry_perl_51801>scandeps -e "use strict" [ERROR] Fetching of 'ftp://ftp.cpan.org/pub/CPAN/authors/01mailrc.txt. +gz' failed: Ftp creation failed: Net::FTP: connect : 10060 [ERROR] Fetching of 'http://www.cpan.org/authors/01mailrc.txt.gz' fail +ed: Could not open socket to 'www.cpan.org', '' [ERROR] Fetching of 'ftp://cpan.hexten.net/authors/01mailrc.txt.gz' fa +iled: Ftp creation failed: Net::FTP: connect: 1006 0 [ERROR] Fetching of 'ftp://cpan.cpantesters.org/CPAN/authors/01mailrc. +txt.gz' failed: Ftp creation failed: Net::FTP: con nect: 10060 [ERROR] Fetching of 'ftp://ftp.funet.fi/pub/languages/perl/CPAN/author +s/01mailrc.txt.gz' failed: Ftp creation failed: Ne t::FTP: connect: 10060 [ERROR] Fetch failed: host list exhausted -- are you connected today? [ERROR] Couldn't fetch '01mailrc.txt.gz' [ERROR] Fetching of 'ftp://ftp.cpan.org/pub/CPAN/modules/03modlist.dat +a.gz' failed: Ftp creation failed: Net::FTP: conne ct: 10060 [ I ctrl-c'd it at this point ]
I am behind firewalls where I work, so I'm not even sure I can open this up to allow FTP or HTTP to work. But I have to ask why it needs to consult anything other than the local perl install tree for module dependency info? Shouldn't it just be looking recursively at "use" statements?

Replies are listed 'Best First'.
Re^5: PAR::Packer pp command including too many modules
by Anonymous Monk on Mar 15, 2014 at 07:28 UTC

    Yes, but ...

    You're using portablestrawberry, it loads Portable when you run any program ...

    You can always exclude Portable and any other module syou don't want packed

    ... scandeps ...

    portablestrawberry loads Portable when scandeps runs too :)

    But I have to ask why it needs to consult anything other than the local perl install tree for module dependency info? Shouldn't it just be looking recursively at "use" statements?

    metadata also comes from the CPAN ... you've got the portable version so load it up before you go to work :)

    ;) When in doubt feel free to UTSL

      Holy crappola, you're a genius! This worked, and produced a smallish exe with only 18 unnecessary modules:
      pp -X Portable.pm -e "use strict; print 1..99" -o ttt.exe

      But I guess I still disagree with the coders of PAR::Packer that Portable.pm should be included by default, for some definition of default. To include it because you merely "use strict;" just seems wrong to me.

      Anyhow, thanks a lot for your work-around. It suits my purposes well. I had almost given up hope of getting a reasonable size exe.

      John

        But I guess I still disagree with the coders of PAR::Packer ....

        I have my perl configured to use Data::Dump by default , if I use pp to pack anything Data::Dump gets included unless I exclude it ...

        strawberryperlportable loads Portable by default for every perl program, unless you exclude it, par/pp will package it

        If you still feel its a mistake that loaded modules get packaged (which I don't), feel free to file a bug report :)

        I had almost given up hope of getting a reasonable size exe.

        everybody has got a funny definition of reasonable :)