Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Upgrading CPAN - Yes We Can

by jdrago_999 (Hermit)
on Jun 04, 2009 at 16:03 UTC ( [id://768482]=note: print w/replies, xml ) Need Help??


in reply to Re: Upgrading CPAN - Yes We Can
in thread Upgrading CPAN - Yes We Can

could you add alternate (disjunctive) module dependencies, where a module can depend on different combinations of other modules (and module versions)?

This is Perl. Of course we can :P

Actually I'm sure that it's possible simply by extending the grammar or perhaps even with something like this:

use any(qw( ModuleA ModuleB ModuleC ));

Replies are listed 'Best First'.
Re^3: Upgrading CPAN - Yes We Can
by ambrus (Abbot) on Jun 04, 2009 at 16:43 UTC

    No, I mean dependencies the CPAN installer handles, so that when a module is installed it installs all the dependencies as well. (There are two varieties of these: dependencies that are only needed for building and that need to be permanently installed, but that is irrelevant now.)

    The difficult part with these is that you don't want to make everyone update their CPAN package, so the only way this could go is that the info file of new modules can contain both the old style dependencies (which is just a plain conjunction of versioned modules) and new style ones. However, as ExtUtils::MakeMaker generates the info file from Makefile.PL, it could also write a sensible default for the old style if you give a dependency expression that has disjunctions in it.

      I don't think I understand what you are saying.

      Are you talking about (for example) if you use Module::Install how you can say:

      requires 'My::Module' => 1.02;

      ...or...

      test_requires 'My::Module' => 1.02;

      ...but not:

      requires_any => ( 'My::Module' => 1.02, 'My::OtherModule' => 2.33, );

      I suppose that the requires_any kind of logic could be implemented simply as a Module::Install plugin.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://768482]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-06-16 14:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.