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

Respectful obeisances, My Perl installation got updated to 5.28.1 by my OS (openSUSE) and ever since then some of my scripts complain about missing some of my modules and cpan interactive shell quits with complaints about lock files and segmentation faults. I can usually install missing modules using cpanminus and proceed doing whatever I was doing but I still need to fix cpan. As of now, I get this (edit: corrected misspelled command in original message):
stan@linux-pwfe:~> sudo perl -d -MCPAN -e shell [sudo] password for root: Loading DB routines from perl5db.pl version 1.53 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): shell *** buffer overflow detected ***: perl terminated Aborted stan@linux-pwfe:~>
Cpan itself responds to "sudo cpan -h" and "sudo cpan -v" and it even updated cpan itself via "sudo cpan -i CPAN". It can't find and install missing "CAN.pm" this way, though. Edit - another example:
stan@linux-pwfe:~> sudo cpan [sudo] password for root: Loading internal logger. Log::Log4perl recommended for better logging There seems to be running another CPAN process (pid 8012). Contacting +... Other job not responding. Shall I overwrite the lockfile '/root/.cpan/ +.lock'? (Y/n) [y] y cpan shell -- CPAN exploration and modules installation (v2.22) Enter 'h' for help. Segmentation fault stan@linux-pwfe:~> sudo rm /root/.cpan/.lock stan@linux-pwfe:~> sudo cpan Loading internal logger. Log::Log4perl recommended for better logging cpan shell -- CPAN exploration and modules installation (v2.22) Enter 'h' for help. *** buffer overflow detected ***: /usr/bin/perl terminated Aborted stan@linux-pwfe:~>

Replies are listed 'Best First'.
Re: Broken cpan shell
by kcott (Archbishop) on Jan 14, 2019 at 05:05 UTC

    G'day stangoesagain,

    Your problem is just a typo (missing a 'P'):

    s/-MCAN/-MCPAN/

    If that's not clear, see perlrun which explains the command switches (including '-M').

    — Ken

      Oh, sorry, I must have copied from the wrong shell command in bash history. Anyway, this should be correct:
      stan@linux-pwfe:~> sudo perl -d -MCPAN -e shell [sudo] password for root: Loading DB routines from perl5db.pl version 1.53 Editor support available. Enter h or 'h h' for help, or 'man perldebug' for more help. main::(-e:1): shell *** buffer overflow detected ***: perl terminated Aborted stan@linux-pwfe:~>

        You have completely changed your original post. My response to what you originally wrote now makes absolutely no sense.

        Please read "How do I change/delete my post?". In particular, the section entitled "It is uncool to update a node in a way that renders replies confusing or meaningless".

        — Ken

        Looks unpleasant :(

        I can't help with this one, but I suggest you edit the original post to indicate the actual issue - folks might miss the problem if it's buried in an Re^2.


        Mike