in reply to interactive mode cpan. "cpan" doesn't work. "perl -MCPAN -e shell" does

What?

Its simple, delete the existing cpan file, and re-install CPAN

  • Comment on Re: interactive mode cpan. "cpan" doesn't work. "perl -MCPAN -e shell" does

Replies are listed 'Best First'.
Re^2: interactive mode cpan. "cpan" doesn't work. "perl -MCPAN -e shell" does
by Jeri (Scribe) on Feb 12, 2014 at 20:51 UTC
    haha really?
      Thanks, sorry. It seemed complicated. Need to take a break.

        Dude :) yes really

        When you install modules that install perl "EXE_FILES" their shebang gets rewritten to point to the perl doing the installing

        If you uninstall/remove/delete... that perl but the "EXE_FILE" that was installed using that perl remains ... this case your "cpan" file ... then its probably pointing to the wrong perl, one which doesn't exist ... thus the error message ( from your shell )

        So, cheapest way to fix it, is remove the offending file

        At this point, if the other perl is in your path, trying to execute cpan should call the new perls cpan file which will have the correct shebang for the new perl and call the correct perl

        If this isn't the case, and there just is no cpan file anymore, this is where reinstalling CPAN module comes in, it will install cpan EXE_FILE with correct shebang

        You can always look inside the "cpan" file you're trying to execute to see the paths it contains

        cpan probably isn't the only file with the wrong shebang