Thu Apr 01 12:21:58 2010: Request 56171 was acted upon.
Transaction: Correspondence added by DJIBEL
Queue: PAR-Packer
Subject: Can't locate PerlIO.pm
Broken in: 1.002
Severity: Critical
Owner: Nobody
Requestors: [email protected]
Status: resolved
Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=56171 >
Le Mer 31 Mar 2010 14:47:50, RSCHUPP a écrit :
> On Wed Mar 31 13:45:54 2010, DJIBEL wrote:
> > Dear,
> >
> > I am using Activeperl Binary build 1007 [291969].
> > PAR::PAcker 1.002, PDF::API2 0.73
> >
> > When I package this script :
> >
> > #!/usr/bin/perl
> > use strict;
> > use warnings;
> > use PDF::API2;
> >
> > Can't locate PerlIO.pm in @INC (@INC contains:
> > C:\Users\user\AppData\Local\Temp\par-user\cache-
> > 31b4270c10dbd27682a5add65c
> > 2321943bd7f61d\inc\lib
> > C:\Users\user\AppData\Local\Temp\par-user\cache-
> > 31b4270c10dbd27682a5add65c2321943bd7f61d\inc
> > CODE(0x28cdbec) CODE(0x28cdeec)) at PDF/API2.pm line 212.
>
> And this line is
>
> CORE::open($fh, "+<", \$filestr) ...
>
> i.e. prepare to read from string $filestr via $fh
> (cf. the documentation for PerlIO::scalar).
> This attempt implicitly require's PerlIO.pm.
>
> IMHO it is impossible to detect this usage by static analysis
> from Module::ScanDeps. (The latter module is used by pp to detect
> all other modules etc required by your script.)
>
> In your case you can work around this by using the option "-x" for pp.
> In addition to static analysis, this will actually run
> your script and extract the information which modules were
> actually loaded during the run. This will work since
> PDF::API2 does the above already in a BEGIN block. In the
> general case, it depends on the actual execution path
> whether we detect PerlIO.pm or not.
>
> Hmmm... We had a similar problem with Errno.pm. This will
> implicitly be require'd whenever someone treats $! as a string.
> We ended up adding Errno.pm to the list of modules that
> will always get packed in. Maybe we should do the same with
> PerlIO.pm? This would add a paltry ~20 KB to every pp'ed executable.
>
>
Thank you for your answers.
By using this command now, it is work very well :
pp -o test.exe test.pl -x -M PDF::API2
Djibril