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

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

I installed a cpan module with cpanm which reports: 1 distribution installed. All I can find is an install.json and an empty .packlist. Also "perllocal.pod" is appended! I browsed the module files on cpan but can't figure out why this happens with Astro::SpaceElevator (and its spiffy utf8 source: my $Δ = $P - $V).
  • Comment on cpanm says OK but module not really installed

Replies are listed 'Best First'.
Re: cpanm says OK but module not really installed
by swl (Parson) on Oct 19, 2019 at 09:32 UTC

    This is an odd one. I just installed it using Strawberry 5.28.0 under berrybrew, and there is no file called SpaceElevator.pm that is installed.

    Checking the blib dir when using cpanm --look:

    cpanm --look Astro::SpaceElevator gmake

    and then run under bash for windows from the build dir:

    find blib -print blib blib/arch blib/arch/.exists blib/arch/auto blib/arch/auto/Astro blib/arch/auto/Astro/SpaceElevator blib/arch/auto/Astro/SpaceElevator/.exists blib/bin blib/bin/.exists blib/lib blib/lib/Astro blib/lib/Astro/.exists blib/lib/auto blib/lib/auto/Astro blib/lib/auto/Astro/SpaceElevator blib/lib/auto/Astro/SpaceElevator/.exists blib/man1 blib/man1/.exists blib/man3 blib/man3/.exists blib/script blib/script/.exists

    There is nothing obvious in the Makefile.PL that comes with the distro, so perhaps others can shed some light?

    (Minor edit - fix newline that snuck into the find command line)

      A few minutes later, here is a fix:

      1. Move the Astro dir into lib/Astro

      2. Update Makefile.PL to get the version from lib/Astro/SpaceElevator.pm

      Then run the usual perl Makefile.PL and [dg]?make process.

      The fact that there are no tests is something else that could be fixed.

        Sure this will put things in the right place, but even running the example code from the POD results in an error, while testers lists some 'success', it isn't looking good:

        use Astro::SpaceElevator; my $elevator = Astro::SpaceElevator->new(0, 120, 100_000, time()); print "The elevator leaves the Earth's shadow at " . ($elevator->shado +ws->{Earth}{penumbra})[1] . "km above the base.\n";

        returns

        Too many arguments at /usr/local/share/perl/5.26.1/Astro/SpaceElevator +.pm line 204.
        # first we check to see if the sun has risen over the base station +. my (undef, $elevation, undef) = $base->azel($sun, 1); # line 204
Re: cpanm says OK but module not really installed (updated)
by haukex (Archbishop) on Oct 19, 2019 at 08:36 UTC

    cpanm -v should show where it's installing the module, and you can use perl -V to see @INC where Perl is looking for modules. Perhaps you have more than one Perl installation on this machine (perlbrew?) or you're using something like local::lib?

    Update: Ah, it does seem the distro is at fault here. See swl's posts.

Re: cpanm says OK but module not really installed
by ikegami (Patriarch) on Oct 19, 2019 at 13:30 UTC

    You probably installed the module in a non-standard location (e.g. using env var PERL_MB_OPT or PERL_MM_OPT), but didn't tell Perl to look there (e.g. via env var PERL5LIB).

    What's the output of

    set | grep ^PERL
Re: cpanm says OK but module not really installed (verbose log)
by Anonymous Monk on Oct 19, 2019 at 09:04 UTC
    Look at the log. Increase verbosity and look at the log. The log tells all.