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

Hi all,

today i packed a script using pp under a perlbrew environment on Mac OS X.

The only none core module i used was Net::Traceroute which i installed using cpanm under perlbrew.

To my surprise pp referred to @INC of the system Perl and told me that Net::Traceroute is not in @INC.

N.B.: which told that i use the right pp.

After i disabled perlbrew and installed the missing module to the system Perl everything worked.

In other words: It seems like pp or perlbrew confuses the include path.

Any further hints what is going on here?

Thank you very much and best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

Replies are listed 'Best First'.
Re: PAR::Packer/perlbrew confusion
by kcott (Archbishop) on Nov 28, 2015 at 02:36 UTC

    G'day Karl,

    I'm running: Mac OS X 10.10.3; perlbrew 0.73; perl 5.22.0

    I suspect your problem is that you're running the system pp (i.e. /usr/bin/pp) which, in turn, is invoking the system perl.

    While I do use pp in other OSes, I've never needed it here (Mac OS X) so you could say I have factory settings. Consider the following:

    $ which pp /usr/bin/pp $ cpan ... cpan[1]> install pp ... Installing /Users/ken/perl5/perlbrew/perls/perl-5.22.0t/bin/pp ... $ which pp /Users/ken/perl5/perlbrew/perls/perl-5.22.0t/bin/pp

    Doing the same may fix your issue. See how you go.

    — Ken

      "...you're running the system pp..."

      Yes. This is what i observed.

      I forgot to install PAR::Packer under perlbrew.

      But after i installed it under perlbrew pp still used @INC of the system Perl.

      As i was in a hurry and needed to deliver something ASAP, my only chance was to trash my system Perl.

      Thanks for advice and best regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

        Reading your response, a memory (from quite some time ago) resurfaced of a similar problem I had.

        Given the length of time that's passed, I won't guarantee my recollection is perfect, but I seem to recall that I had an issue where perlbrew itself was invoking the system perl via the shebang line.

        #!/usr/bin/perl

        The perlbrew script is installed under the user's home directory. For me:

        $ which perlbrew /Users/ken/perl5/perlbrew/bin/perlbrew

        I manually modified that. I believe I only changed the shebang line (and, thankfully, added comments about what I did). Given the executable part of the script is tiny, here it is in its entirety (minus POD):

        #!/Users/ken/perl5/perlbrew/perls/perl-5.18.1t/bin/perl # Use a known, stable perl version (with App::perlbrew installed) inst +ead of: ##!/usr/bin/env perl # which never has App::perlbrew installed when a new perlbrew perl is +installed # or ##!/usr/bin/perl # which is a system perl not to be modified (e.g. by installing App::p +erlbrew) use strict; use App::perlbrew; my $app = App::perlbrew->new(@ARGV); $app->run(); __END__ ... remainder of file is POD ...

        I have installed, and successfully used, three more versions of Perl since perl-5.18.1t:

        $ perlbrew list perl-5.14.2 perl-5.14.2_WITH_THREADS perl-5.18.0t perl-5.18.1t perl-5.20.0t perl-5.20.2t * perl-5.22.0t

        So, at least to date, this tactic has worked well. Perhaps it will for you as well.

        "... was to trash my system Perl."

        I understand you did what you did for pragmatic reasons; however, I rather expect this will come back to bite you in the bum. My recommendation would be to reinstall the system perl; although, as I've never had to do this, I'm unable to advise how to go about it.

        — Ken

Re: PAR::Packer/perlbrew confusion
by james28909 (Deacon) on Nov 27, 2015 at 21:59 UTC
    I also had trouble (in win32) sort of liek this a few times, turns out rebooting the system helped my issue. good luck :)
      "...good luck..."

      Thank you very much. I'll do my very best ;-)

      Best regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

Re: PAR::Packer/perlbrew confusion
by Anonymous Monk on Nov 27, 2015 at 21:50 UTC

    Any further hints what is going on here?

    Turn on verbosity and find out

      ...verbosity...

      I'll try it. But i guess it doesn't help much. Don't ask why i didn't set that option #:-{ OK, i was in a hurry and totally bugged.

      Thanks for advice and best regards, Karl

      «The Crux of the Biscuit is the Apostrophe»