This still hangs for me on linux 5.8.4 and mac 5.8.6 at least.

  perl -e 'use Module::Build;
    my $a = Module::Build->prompt("foo", "a"); warn $a;' > /dev/null

Again, why fileno and not this?

 return $ENV{PERL_MM_USE_DEFAULT} ||
  ( !$self->_is_interactive && (-t STDIN || eof(STDIN));

Actually, what I don't understand is why it doesn't hang for everybody.

--Eric
----------  Forwarded Message:  ----------

Subject: [svn:Module-Build] r9182 - in Module-Build/trunk: . 
lib/Module/Build
Date: Thursday 01 March 2007 04:35 am
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

Author: kwilliams
Date: Thu Mar  1 04:35:28 2007
New Revision: 9182

Modified:
   Module-Build/trunk/Changes
   Module-Build/trunk/lib/Module/Build/Base.pm

Log:
Fix a hang in prompt()

Modified: Module-Build/trunk/Changes
=======================================================================
======= --- Module-Build/trunk/Changes  (original)
+++ Module-Build/trunk/Changes  Thu Mar  1 04:35:28 2007
@@ -1,5 +1,8 @@
 Revision history for Perl extension Module::Build.

+ - Improved our prompt() method, which could sometimes hang before the
+   user got a chance to see a prompt. [Andreas Koenig]
+
  - Added DragonflyBSD to the list of known Unix OSes.

  - get_action_docs() dies on error rather than twiddling $@

Modified: Module-Build/trunk/lib/Module/Build/Base.pm
=======================================================================
======= --- Module-Build/trunk/lib/Module/Build/Base.pm (original)
+++ Module-Build/trunk/lib/Module/Build/Base.pm Thu Mar  1 04:35:28
 2007 @@ -471,7 +471,8 @@

 sub _is_unattended {
   my $self = shift;
-  return $ENV{PERL_MM_USE_DEFAULT} || ( !$self->_is_interactive && eof
 STDIN ); +  return $ENV{PERL_MM_USE_DEFAULT}
+         || ( !$self->_is_interactive && !defined fileno STDIN );
 }

 sub _readline {

-------------------------------------------------------

-- 
We who cut mere stones must always be envisioning cathedrals.
--Quarry worker's creed
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

Reply via email to