Marty
Marty

Reputation: 2808

Why CPAN.pm install Moose when I only wanted Mo?

I have the need for a lightweight object system in a perl5 script. After reading the documentation for Mouse.pm, Moo.pm and Mo.pm, I was tossing up between Moo and Mo. The deciding factor in the end was that the Mo module has no dependencies (see right-hand side of page - "DEPENDENCIES" is grey out).

So, I go ahead with what I thought would be a simple install:

User@Ubuntu-iMac:~$ perl -MCPAN -e shell
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.05)
Enter 'h' for help.

cpan[1]> Terminal does not support GetHistory.
Lockfile removed.
User@Ubuntu-iMac:~$ sudo perl -MCPAN -e shell
[sudo] password for User: 
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v2.05)
Enter 'h' for help.

cpan[1]> install Mo
Reading '/home/User/.cpan/Metadata'
  Database was generated on Tue, 23 Feb 2016 02:17:02 GMT
Running install for module 'Mo'
Fetching with LWP:
http://www.cpan.org/authors/id/I/IN/INGY/Mo-0.39.tar.gz
Checksum for /home/User/.cpan/sources/authors/id/I/IN/INGY/Mo-0.39.tar.gz ok
Scanning cache /home/User/.cpan/build for sizes
............................................................................DONE
Configuring I/IN/INGY/Mo-0.39.tar.gz with Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Mo
Writing MYMETA.yml and MYMETA.json
  INGY/Mo-0.39.tar.gz
  /usr/bin/perl Makefile.PL INSTALLDIRS=site -- OK
Running make for I/IN/INGY/Mo-0.39.tar.gz
---- Unsatisfied dependencies detected during ----
----            INGY/Mo-0.39.tar.gz           ----
    Moose [requires,optional]
    IO::All [requires,optional]
    Mouse [requires,optional]

 ... many lines of installation of dozens of modules deleted ...

So my question is - why did it think it needed Mouse, IO::All and, most painfull of all, Moose? Note I can see it says [requires,optional] - but I thought those two terms were contradictory.

Upvotes: 4

Views: 485

Answers (0)

Related Questions