For some reason I'm not getting the libraries in my par exe that I want. I've boiled the problem down to the following test case:

c:\temp\test\lib\strict.pm:

package strict; $VERSION = 1001; 1;
c:\temp\test\test.pl:
use strict 100; print "strict=$INC{'strict.pm'}\n";
Then when packaging I get:
C:\temp\test>c:\strawberry\perl\bin\perl.exe c:\strawberry\perl\bin\pp + -x -I lib test.pl strict=lib/strict.pm Unquoted string "prefork" may clash with future reserved word at c:/st +rawberry/perl/site/lib/PAR.pm line 16, <_FH> chunk 1. C:\temp\test>c:\strawberry\perl\bin\perl.exe c:\strawberry\perl\bin\pp + -c -I lib test.pl strict version 100 required--this is only version 1.04 at GbLRp4 line +4. BEGIN failed--compilation aborted at GbLRp4 line 4. Couldn't open GbLRp4.out at c:/strawberry/perl/site/lib/Module/ScanDep +s.pm line 1266.
The warning about the unquoted string doesn't really interest me. The point is that -x works (finds strict version 1001), but -c (or -o) doesn't work.

What I'm trying to do is create a portable binary, with a different version of a library which is also in core. It seems that when I try to create an exe (with -o or -c), my local strict.pm is ignored in favour of the global one. In reality it's Win32::TieRegistry I'm trying to distribute with my exe (because the cpan version still doesn't include this patch).

I've also tried adding -Ilib to the perl switches (between perl.exe and pp). As a workaround I will update my global version of the module just for compiling :(.

Thanks for any help on this.



- Boldra

In reply to strawberry par::packer, @INC and the difference between -c and -x by Boldra

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.