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

I'm working on Tie::FTP as a comaintainer, and I have a minor difference of opinion with the module's author on configuration.

I have used prompts in Makefile.PL to glean the necessary settings to run full tests (including FTP server, username and password). I provide sensible defaults for the CPAN Testers' auto test suite.

The code is here: http://www.ivorw.com/svn/cpan/Tie-FTP/trunk/Makefile.PL

nuffin reckons that using environment variables is somehow more friendly to users of CPAN.pm. Personally, I don't mind if I'm prompted in the middle of a CPAN shell session, but I'm wondering what other module authors and module installers think.

--

Oh Lord, won’t you burn me a Knoppix CD ?
My friends all rate Windows, I must disagree.
Your powers of persuasion will set them all free,
So oh Lord, won’t you burn me a Knoppix CD ?
(Missquoting Janis Joplin)

  • Comment on Best practice for module test config options

Replies are listed 'Best First'.
Re: Best practice for module test config options
by gellyfish (Monsignor) on Aug 25, 2006 at 08:26 UTC

    This seems to be one of those things that people are evenly split over, for every module that prompts there is one that uses environment variables. For myself I would probably sit on the fence and check the environment variables and only if they aren't set then prompt. I would also probably ask if they wanted to do the tests that require a working network at all if the environment variables aren't set: there might be a variety of local reasons why they can't access an FTP server at the time they are installing the module. Also bear in mind that it isn't just CPAN testers who might want to be doing an automated install.

    /J\

Re: Best practice for module test config options
by syphilis (Archbishop) on Aug 25, 2006 at 10:24 UTC
    Well .... iff you can positively, definitely, get away without prompting then there's no need to prompt. Otherwise, prompt. I find it exceedingly annoying to have to wade through some halfsmart Makefile.PL that failed to work out what it reckoned it was gunna work out. Otoh, a prompt for relevant info has never irritated me.

    Cheers,
    Rob
Re: Best practice for module test config options
by dtr (Scribe) on Aug 25, 2006 at 15:25 UTC

    At work, we bundle all perl modules (including ones that we write) up into deb files for release to QA and to production. Makefiles that prompt for information make this process annoying.

    On the other hand, automated build scripts are definitely less common than people installing modules using perl -MCPAN -e shell. I'd probably suggest that you make it as easy as possible for regular users to install in this way - which (IMHO) means prompting for information where needed.

Re: Best practice for module test config options
by Anonymous Monk on Aug 25, 2006 at 12:27 UTC
    YAML is not a core module, so its better to write a 10 line function to save your configuration information.

      I'm confused...when has anyone in this discussion mentioned using YAML?

      ----Asim, known to some as Woodrow.

        OP said The code is here: http://www.ivorw.com/svn/cpan/Tie-FTP/trunk/Makefile.PL .