Summarizing: I'm pretty certain that Module::Build->prompt now does the same thing as ExtUtils::MakeMaker. The exception is that it checks (as it always has) whether a default was passed via the API when we're not interactive. The net change is mostly just that the stricture is now checked after the prompt is printed.
Highlights: 1. check "do we have a default" + _is_unattended() *after* printing the prompt (this check is required for the "you have no default" strictures.) 2. _is_unattended() is still going to check eof(STDIN). This makes it block just as much as readline() would. This means we can't call it before prompting, but see my previous message for yet another reason that fileno isn't working. See (1) for why this is no longer a problem. 3. prompt("foo", undef) is now a valid usage. Is there any reason that it shouldn't be? 4. Ok, so you want it to behave like rm -i/ftp/grep. Fine. I guess. I cleaned up the prompt() documentation in API.pod to try to make this clear. I still don't like it, but can't really argue with history if yesterday is held to be more important than tomorrow. I would rather have it behave according to spec than not, so "what's right" will have to wait. Since there was such a stink made about eof() being "evil", I think it deserves an explanation. If somebody really wants to get rid of the eof check, they would have to redo _readline() to distinguish between a user hitting Ctrl+D interactively and eof on a scripted input. (Note, a user hitting Ctrl+D interactively with STDOUT not on the terminal will trigger the "must have default" strictures, but I don't believe this is anything new.) As long as we're going to try reading STDIN anyway, eof isn't a problem so long as we get the prompt out first. The original issue was simply that we were checking _is_unattended() as if it had no consequences, so the solution is to "be careful" with it and never call it before prompting. Finally, who has some bright ideas about how to reliably test all of this in a cross-platform manner? Would an alarm in a child process work on windows? --Eric -- "...our schools have been scientifically designed to prevent overeducation from happening." --William Troy Harris --------------------------------------------------- http://scratchcomputing.com ---------------------------------------------------