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

I'm playing around with Perl on my Raspberry Pi 1 running the latest Raspbian. Trying to install modules to a perlbrewed Perl fails silently when commands like "cpan install $module" are issued. Watching with top indicates that there is too little memory. This is not particularly surprising since the Pi 1 has only 256MB of RAM. Installing with cpanm, on the other hand, works fine. Obviously, increasing the memory of the Pi is impossible and adding disc via a USB2 interface will be slow to swap. Is cpanm the best way to go, or are there better approaches when modules have dependencies that need resolving?

Regards,

John Davies

Replies are listed 'Best First'.
Re: Cpan utility fails with low memory
by Corion (Patriarch) on Sep 15, 2015 at 11:52 UTC
Re: Cpan utility fails with low memory
by marto (Cardinal) on Sep 15, 2015 at 12:22 UTC
Re: Cpan utility fails with low memory
by Myrddin Wyllt (Hermit) on Sep 15, 2015 at 13:17 UTC

    My RasPi died at the beginning of the year, so I can't check directly, but I remember having the same sort of trouble with CPAN. I had to change some parameters in the config.txt file on the boot partition (gpu_mem was one of them), and boot to the command line (so essentially turn off everything that wasn't absolutely necessary). Also had a 2GB swap on the SD card.

    I did manage to install a working Catalyst::Devel doing that, although it took a while to build!

    So, in short, it can be done, but you're better off just using cpanm.