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

Well, I am probably revealing myself as a societal outcast for posting on Christmas, but here I am :)

Anyway, I just set prerequisites_policy' => q[follow]"in Config.pm, in my ongoing quest to make catalyst install on a shared host slightly less painful.

It is set to "ask" by default, which for me seems counterintuitive, since the whole point of cpan is to make life easier, and answering yes, yes, yes, yes, yes for prereq after prereq seems not the way to go.

So my question is, is there a reason cpan defaults to ask instead of follow? And if so, where is safe to follow, and under which conditions are you better off having cpan ask?

  • Comment on Why does CPAN default to "ask" when grabbing dependencies? Why not just follow?
  • Download Code

Replies are listed 'Best First'.
Re: Why does CPAN default to "ask" when grabbing dependencies? Why not just follow?
by jhourcle (Prior) on Dec 25, 2005 at 18:24 UTC

    Because it's safer.

    If you've ever tried dealing with a 'new' sysadmin, who decides to install a new package, which has a dependancy on a module with a different version, and that breaks something else on the box, and you have to spend the weekend trying to track down what they changed, because they won't fess up.

    (It was ~5 years ago ... the module that got modified was Net::LDAP ... I don't remember what triggered the whole thing, but somehow, the script that we used for automating account creation for a 35k user mail system just stopped working ... luckily, it was a pure perl module, so I grabbed the older version from the development box.)

    Where is it safe to follow? Any time you're not replacing anything that's already in existance ... but that may not be a file rewrite ... if you have multiple module locations, something might find the newer module first. Luckily, in those cases, it's easier to recover.

      Very enlightening, thanks. Apprently a fix for this "new version breaks modules dependent on old version" problem is something larry is taking very seriously in perl6. Or at least something he talked about in an interview:

Re: Why does CPAN default to "ask" when grabbing dependencies? Why not just follow?
by helphand (Pilgrim) on Dec 25, 2005 at 17:59 UTC
    It is set to "ask" by default, which for me seems counterintuitive, since the whole point of cpan is to make life easier, and answering yes, yes, yes, yes, yes for prereq after prereq seems not the way to go.
    As I recall, when I installed CPAN on my box, it asked me whether I wanted it to ask or follow automatically. The default, if you press return, is ask. So, basically, you are making the decision when you install the CPAN package. Scott
Re: Why does CPAN default to "ask" when grabbing dependencies? Why not just follow?
by ysth (Canon) on Dec 25, 2005 at 18:13 UTC
    Some people have the somewhat odd approach of wanting to know what they have installed.
Re: Why does CPAN default to "ask" when grabbing dependencies? Why not just follow?
by jbrugger (Parson) on Dec 26, 2005 at 10:22 UTC
    I'm glad that this happens, using Debian, i'd like to have as much possible modules using the apt-get method (debian packages)
    When asking for a dependency, i first look if the Debian package is there, than i install that one, if not, i take the cpan module.

    "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
Re: Why does CPAN default to "ask" when grabbing dependencies? Why not just follow?
by ambrus (Abbot) on Dec 26, 2005 at 15:53 UTC

    One thing perlmonks has thought to me is not to question defaults. Some people definitely like that behaiviour, that's why they have set it. If you don't like it, you can change the configuration option "prerequisite_policy" provided that you can spell that word correctly.