On Wednesday, Jul 30, 2003, at 06:50 Europe/Amsterdam, Struan Donald wrote:
If you don't want to read about Perl look away now.well, technically i think you're supposed to mark it [OT] on the london.pm list if the word 'perl' is mentioned anywhere in the body. but we'll forgive you ;)
interactive tests are not very nice to be honest, so try and leave your interactivity, if at all necessary, in one place.In cases where you require some information to perform a test (say a database name, or login information) is there an accepted way of doing it? More specifically is there some way I can ask for the information and if I don't get a response in x seconds assume either defaults or SKIP the test?
the accepted procedure[1] nowadays is to do something roughly like the following:
* write an interactive Makefile.PL/Build.PL that gathers the information.
* write this information out to a config file, so it can be reused for multiple installs.
* try and have command line switches that give the answers to your question, so interactivity is not needed when the person knows what to do, ie;
perl Makefile.PL --db=foo --db-user=bar --db-pass=zot
* alternately, use %ENV variables, but this is the method of last resort.
this greatly increases the chances of installers dealing with it correctly, as well as automating installation processes where needed.
-- Jos Boumans
"Cocaine is God's way of telling you you make too much money"
CPANPLUS http://cpanplus.sf.net
[1] this just means this is how people are doing it lacking any official guidelines, and is one CPANPLUS can cope with, so i'm happy enough to endorse it.