Bloehdian has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

when trying to compile a perl program using pp I get the following error message:

$ pp -B -o program.exe program.pl Can't locate PAR/StrippedPARL/Static.pm in @INC (@INC contains: ../lib + ../lib /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl +5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/shar +e/perl5 .) at /usr/local/share/perl5/PAR/Packer.pm line 1269.

The OS is Linux Rehat 6.7 with Perl 5.10 installed, PAR::Packer is of version 1.049.

In fact, checking the path /usr/local/share/perl5/PAR/StrippedPARL, I find a perl module file Base.pm, but not Static.pm.

I know that a file Static.pm existed in quite old versions of PAR::Packer.

Is this a Perl version problem?

Replies are listed 'Best First'.
Re: Module Static.pm not found when using perl packer
by marto (Cardinal) on Jul 21, 2020 at 07:27 UTC
Re: Module Static.pm not found when using perl packer
by kcott (Archbishop) on Jul 21, 2020 at 08:48 UTC

    G'day Bloehdian,

    The PAR::StrippedPARL::Static (and PAR::StrippedPARL::Dynamic) modules were last distributed with 1.010; they were absent from 1.011.

    In the Changes file, under '1.037  2017-05-28', you'll see:

    "Fail early when packing with a version of Perl that's different frome the one PAR::Packer was built with. Scenario: User has built and installed PAR::Packer ... then installs a newer version of Perl ..."

    As pp is now a module as well as a script, you can get version and location information about both of those, and equivalent information about perl, with these commands:

    $ perl -E 'use pp; say $INC{"pp.pm"}; say $pp::VERSION;' $ which pp $ pp -V $ which perl $ perl -v

    I'd also check the shebang line in program.pl.

    I concur with the advice[1,2] from both ++choroba1 and ++marto2. Your problem could be either; or a combination of both. If digging deeper (using the suggestions above) doesn't resolve your issue, post your results and we can look at it further.

    — Ken

Re: Module Static.pm not found when using perl packer
by choroba (Cardinal) on Jul 21, 2020 at 07:00 UTC
    Are you sure all the paths belong to the same perl version? Especially mixing /usr/local with /usr/lib64 and /usr/share seems suspicious.

    map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

      Hello again,

      o.k., first with regard to the version stuff:

      [user@server bin]$ perl -E 'use pp; say $INC{"pp.pm"}; say $pp::VERSIO +N;' /usr/local/share/perl5/pp.pm 1.050 [user@server bin]$ which pp /usr/local/bin/pp [user@server bin]$ pp -V PAR Packager, version 1.050 (PAR version 1.016) Copyright 2002-2009 by Audrey Tang <cpan@audreyt.org> Neither this program nor the associated "parl" program impose any licensing restrictions on files generated by their execution, in accordance with the 8th article of the Artistic License: "Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embe +dded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribut +ion. Such use shall not be construed as a distribution of this Pack +age." Therefore, you are absolutely free to place any license on the resulti +ng executable, as long as the packed 3rd-party libraries are also availab +le under the Artistic License. This program is free software; you can redistribute it and/or modify i +t under the same terms as Perl itself. There is NO warranty; not even f +or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [user@server bin]$ which perl /usr/bin/perl [user@server bin]$ perl -vperl -E 'use pp; say $INC{"pp.pm"}; say $pp: +:VERSION;' This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi Copyright 1987-2009, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge. [user@server bin]$ which pp /usr/local/bin/pp [user@server bin]$ pp -V PAR Packager, version 1.050 (PAR version 1.016) Copyright 2002-2009 by Audrey Tang <cpan@audreyt.org> Neither this program nor the associated "parl" program impose any licensing restrictions on files generated by their execution, in accordance with the 8th article of the Artistic License: "Aggregation of this Package with a commercial distribution is always permitted provided that the use of this Package is embe +dded; that is, when no overt attempt is made to make this Package's interfaces visible to the end user of the commercial distribut +ion. Such use shall not be construed as a distribution of this Pack +age." Therefore, you are absolutely free to place any license on the resulti +ng executable, as long as the packed 3rd-party libraries are also availab +le under the Artistic License. This program is free software; you can redistribute it and/or modify i +t under the same terms as Perl itself. There is NO warranty; not even f +or MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. [user@server bin]$ which perl /usr/bin/perl [user@server bin]$ perl -v This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi Copyright 1987-2009, Larry Wall Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using "man perl" or "perldoc perl". If you have access to + the Internet, point your browser at http://www.perl.org/, the Perl Home Pa +ge.

      So far I have no indication that different Perl versions are mixed up on this box.

      BUT:

      I found something very interesting (and weird at the same time):

      program.pl is intended to run on windows and linux boxes as well. We use a Win 2012 server with Strawberry Perl 5.28.2 installed, and, guess, I find Static.pm installed in the directory C:\Strawberry\perl\site\lib\PAR\StrippedPARL, although PAR:Packer on this machine is of version 1.049. And

      pp -B -o program.exe program.pl

      works flawlessly on Windows 2012.

      It seems that the Strawberry guys bundled the "old" modules Static.pm (and Dynamic.pm) into this quite recent Perl (PAR::Packer) distribution. Really embarrassing!

      Any ideas how to proceed? (o.k., I will, just to experiment, copy over Static.pm and Dynamic.pm (from cpan) into the appropriate directory on the Linux machine, but I think this is not only quick (provided it works), but very very DIRTY :->)

      Totally different question:

      When I post my questions here I use an "ordinary" text editor to prepare the text, insert the <p>, </p>, etc. by hand (!) and copy it over to the text box on this site. Inserting the tags is time consuming. I guess that there is a much easier way. How do You do this?

        "It seems that the Strawberry guys bundled the "old" modules Static.pm (and Dynamic.pm) into this quite recent Perl (PAR::Packer) distribution. Really embarrassing!"

        For Strawberry Perl 5.28.2 from the msi:

        marto@Marto-Desktop:~/Downloads/msi/Strawberry$ find . -name "Static.p +m" ./perl/vendor/lib/Mojolicious/Static.pm marto@Marto-Desktop:~/Downloads/msi/Strawberry

        From the 'portable':

        marto@Marto-Desktop:~/portable$ find . -name "Static.pm" ./perl/vendor/lib/Mojolicious/Static.pm marto@Marto-Desktop:~/portable$

        From the 'zip' distro:

        marto@Marto-Desktop:~/zip$ find . -name "Static.pm" ./perl/vendor/lib/Mojolicious/Static.pm marto@Marto-Desktop:~/zip$

        I can't see anything to back up this claim.

        Inserting the tags is time consuming. I guess that there is a much easier way. How do You do this?

        I use a node template. You can set one up in your Signature Settings. Or you could configure your editor to use a template. Or you could use an HTML-aware editor. Or you could use a post-processor (in Perl, of course) to wrap every paragraph outside code blocks in p tags. Or ... so many alternatives!


        🦛 Sig test because I changed it while I was there. :-)