in reply to CPAN module dependencies: possible to depend on A OR B

When writing your prerequisites (for example in your Makefile.PL), check whether one of the two alternatives is installed, and if so, output the prerequisite information for that alternative. If none is installed, choose/specify a default.

Replies are listed 'Best First'.
Re^2: CPAN module dependencies: possible to depend on A OR B
by ivan (Sexton) on May 24, 2010 at 22:55 UTC

    I'm sorry Corion, I should have said that I'm aware of such workarounds and don't feel they are appropriate. The sort of hack you are suggesting does not declare to CPAN tools that e.g. parse META.yml that there are two alternatives available.

    "Choose/specify a default" very much defeats the purpose of an Any module in the first place. Net::HTTPS::Any is unlike Any::Moose, for example - one of the two alternatives is not smaller/lighter-weight than the other and neither is an appropriate default.

    So I'm interested in whether or not there is an actual solution. A definitive "there is no way to declare a dependency on A or B" is certainly useful information as well!

    Thanks again monks for any wisdom you have to offer.

      "Choose/specify a default" very much defeats the purpose

      Nonsense. You already default to using Net::SSLeay over Crypt::SSLeay, Moose over Mouse.

      The installer could always ask which one to install if the install is interactive.