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

Is there a way to blacklist modules for cpan* client(s) which may be installed indirectly (dependency; in case of cpan, "recommends_policy"). Yes, I can turn off "recommends_policy" but that is all-or-nothing decision.

(Well, I installed MCE::Hobo. IO::FDPass was installed for being listed in recommended module. That apparently may not work with perl 5.22+ (5.26 installed here) ...

** Canary::Stability COMPATIBILITY AND SUPPORT CHECK
...
*** However, in recent releases, P5P (who maintain perl) have been
*** introducing regressions that are sometimes subtle and at other times
*** catastrophic, often for personal preferences with little or no concern
*** for existing code, most notably CPAN.
***
*** For this reason, it has become very hard for me to maintain the level
*** of reliability and support I have committed myself to in the past, at
*** least with some perl versions: I simply can't keep up working around new
*** bugs or gratituous incompatibilities, and in turn you might suffer from
*** unanticipated problems.
***
*** Therefore I have introduced a support and compatibility check, the results
*** of which follow below, together with a FAQ and some recommendations.
***
*** This check is just to let you know that there might be a risk, so you can
*** make judgement calls on how to proceed - it will not keep the module from
*** installing or working.
***
*** The stability canary says: (nothing, it was driven away by harsh weather)
***
*** It seems you are running perl version 5.026000, likely the "official" or
*** "standard" version. While there is nothing wrong with doing that,
*** standard perl versions 5.022 and up are not supported by IO::FDPass.
*** While this might be fatal, it might also be all right - if you run into
*** problems, you might want to downgrade your perl or switch to the
*** stability branch.
...

... I am not about to set environment variables for each such module.)

Replies are listed 'Best First'.
Re: module blacklist for cpan*
by perlancar (Hermit) on Jul 04, 2017 at 09:52 UTC

      Thanks, perlancar. Your patch is enough impetus to start using cpanm over cpan.

Re: module blacklist for cpan*
by marioroy (Prior) on Jul 04, 2017 at 13:03 UTC

    Hello Anonymous Monk,

    IO::FDPass works fine with Perl 5.22+. The tests in IO::FDPass including those in MCE::Shared pass. Currently, IO::FDPass is the only module of its kind that works well on multiple platforms including support for AIX and Solaris.

    Regards, Mario

Re: module blacklist for cpan*
by karlgoethebier (Abbot) on Jul 04, 2017 at 08:34 UTC

    It looks like you feel that you've been schmorped, right?

    But as he says:

    "It seems you are running perl version 5.026000, likely the "official" or "standard" version. While there is nothing wrong with doing that, standard perl versions 5.022 and up are not supported by IO::FDPass. While this might be fatal, it might also be all right - if you run into problems, you might want to downgrade your perl or switch to the stability branch."

    IMHO no need to worry. Perhaps this is a reason to use perlbrew?

    But remember:

    "MCE::Shared enables extra functionality on systems with IO::FDPass installed. Without it, MCE::Shared is unable to send file descriptors to the shared-manager process. The use of IO::FDPass applies to Condvar, Queue and Handle (mce_open). IO::FDpass isn't used for anything else."

    Regards, Karl

    «The Crux of the Biscuit is the Apostrophe»

    perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

      I have installed perl 5.26 in my personal space for personal use. I am aware of perlbrew but am not interested in dealing with more than one version.

      I had not directly used or installed MCE::* myself before trying to run small piece of code posted here. The suggestion to switch to "stability branch" or to downgrade only to keep IO::FDPass from causing problems was rather obnoxious.

Re: module blacklist for cpan*
by Tux (Canon) on Jul 04, 2017 at 21:53 UTC

    Yes, amongst the already mentioned methods, for the cpan client, you can use distroprefs. You can use that to block a complete author, in your case somewhat like:

    $ cat ~/.cpan/prefs/MLEHMANN.yml --- comment: "use common sense" match: distribution: "^MLEHMANN/" disabled: 1

    Or you can block all of his modules except for some others:

    $ cat ~/.cpan/prefs/MLEHMANN.yml --- comment: "use common sense" match: distribution: "^MLEHMANN/(?!JSON-XS|Types-Serialiser|Linux-Inotify +2)" disabled: 1

    You can also write patches in your own space and allow certain modules only after being patched:

    $ cat ~/.cpan/prefs/MLEHMANN.JSON-XS.yml --- comment: "use common sense" match: distribution: '^MLEHMANN/JSON-XS-3.(0[3-9]|1*)' patches: - "../../patches/JSON-XS.patch"

    Enjoy, Have FUN! H.Merijn
Re: module blacklist for cpan*
by Anonymous Monk on Jul 04, 2017 at 06:45 UTC
    Chicken little dont worry