http://www.perlmonks.org?node_id=1194628

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

My onion2+ gadget has "perl 5, version 22, subversion 1 (v5.22.1) built for mipsel-linux-musl"

It has no cpanm/-MCPAN/ppm installed, on the FS, or visible in any opkg repos.

I get this when I tried the obvious:-

root@Omega-C50F:~/un/Bundle-CPAN-1.862# perl Makefile.PL Can't locate strict.pm in @INC (you may need to install the strict mod +ule) (@INC contains: /usr/lib/perl5/5.22 .) at Makefile.PL line 1. BEGIN failed--compilation aborted at Makefile.PL line 1.

And this when I pulled "use strict" out of the Makefile.PL

root@Omega-C50F:~/un/Bundle-CPAN-1.862# perl Makefile.PL Can't locate ExtUtils/MakeMaker.pm in @INC (you may need to install th +e ExtUtils::MakeMaker module) (@INC contains: /usr/lib/perl5/5.22 .) +at Makefile.PL line 1. BEGIN failed--compilation aborted at Makefile.PL line 1.

and I'm pretty sure MakeMaker is going to lead to dependancy nightmare...
similar story for CPAN.pm itself (missing strict.pm, vars.pm, MakeMaker too, etc)

For now, I'm not interested in XS or binary - just pure-perl modules.

What's the procedure to bootstrap a working perl environment? (I got the executable via "opkg install perl")

Replies are listed 'Best First'.
Re: Can I install CPAN itself on busybox?
by marto (Cardinal) on Jul 09, 2017 at 19:14 UTC
      it starts with "use strict", which of course will lead to the same problem...

      I've gotten closer to my goal though:

      vi /etc/opkg/distfeeds.conf #remove the comments opkg update opkg upgrade perl opkg install perlbase-cpan
      which now gives this
      root@Omega-C50F:/usr/lib/perl5/5.22# perl -MCPAN -e shell Can't locate ExtUtils/MakeMaker/version/vpp.pm in @INC (you may need t +o install the ExtUtils::MakeMaker::version::vpp module) (@INC contain +s: /usr/lib/perl5/5.24 /usr/lib/perl5/5.22) at (eval 6) line 2. BEGIN failed--compilation aborted at (eval 6) line 2. Compilation failed in require at /usr/lib/perl5/5.24/ExtUtils/MakeMake +r.pm line 9. BEGIN failed--compilation aborted at /usr/lib/perl5/5.24/ExtUtils/Make +Maker.pm line 9. Compilation failed in require at /usr/lib/perl5/5.24/CPAN.pm line 43. BEGIN failed--compilation aborted at /usr/lib/perl5/5.24/CPAN.pm line +43. Compilation failed in require. BEGIN failed--compilation aborted. root@Omega-C50F:/usr/lib/perl5/5.22#
      so I will have another go with makemaker after all...

        strict has been core since perl5 was released. It muddies the waters when distros do things like this.

Re: Can I install CPAN itself on busybox?
by shmem (Chancellor) on Jul 10, 2017 at 06:08 UTC
    (@INC contains: /usr/lib/perl5/5.22 .) at Makefile.PL line 1.

    Looks like a broken perl build to me, @INC having too little entries.
    Do you have /usr/lib/perl, /usr/share/perl and/or /usr/share/perl5 in your FS? If so, add them to @INC running perl -Idirectory (multiple -I possible).

    You could run find / -name strict.pm, see if it turns up and add its directory to @INC. Also, locate Config.pm and do likewise.

    perl -le'print map{pack c,($-++?1:13)+ord}split//,ESEL'
Re: Can I install CPAN itself on busybox?
by stevieb (Canon) on Jul 09, 2017 at 19:10 UTC

    Install perlbrew, install an instance: perlbrew install perl-5.26.0, switch to it: perlbrew switch perl-5.26.0, then perlbrew install-cpanm?

      Interesting idea, although IoT gadgets always have minimal everything, so something for full-blown linux is rarely going to work:-
      root@Omega-C50F:~/un/brew# /root/index.html ## Download the latest perlbrew 2017-07-09 19:45:24 URL:https://raw.githubusercontent.com/gugod/App-pe +rlbrew/master/perlbrew [211020/211020] -> "perlbrew.fgeblo" [1] ## Installing perlbrew Can't locate PerlIO.pm in @INC (you may need to install the PerlIO mod +ule) (@INC contains: FatPacked::11223424=HASH(0xab4180) /usr/lib/perl +5/5.24 .) at perlbrew.fgeblo line 6138. BEGIN failed--compilation aborted at perlbrew.fgeblo line 6151. BEGIN failed--compilation aborted at perlbrew.fgeblo line 6151. root@Omega-C50F:~/un/brew#

        You could say I'm a bit familiar with small/embedded/IoT type stuff, but I admit I completely glazed over that statement in your OP and missed it entirely.

        Can you provide the specs of the particular board you're using and the OS information? Perl will run in tight memory constraints, but it's the storage space that could be an issue. How does the "Onion" attach to disk? Is it custom like a Pi, or is it hard like an Arduino?

        Perhaps with that knowledge, it may be possible to pack up the modules you need, then do a single untar or something...