in reply to Re: IO::Prompt - Cannot write to terminal
in thread IO::Prompt - Cannot write to terminal

Expect is reported to work on Cygwin but not on ActivePerl:

Expect FAQ Can I use this module with ActivePerl on Windows?

However, IO::Prompt says nothing about its usability on alternate systems. It has a list of DEPENDENCIES, all which install without error under ActivePerl along with the module itself. I definitely consider that very bad practice, and will send an email to the module maintainer suggestion that he at the very least add a FAQ entry.

Thanks,
- Miller
  • Comment on Re^2: IO::Prompt - Cannot write to terminal

Replies are listed 'Best First'.
Re^3: IO::Prompt - Cannot write to terminal
by BrowserUk (Patriarch) on Jul 21, 2007 at 02:15 UTC

    The module makes no attempt at portability. It opens dev/tty unconditionally. You can get the prompt to display by changing the first few lines of sub prompt, but after that you are in a world of hurt.

    open $OUT, ($^O eq 'MSWin32' ) ? '>CON' : ">/dev/tty" or croak "Cannot write to terminal: $!" if !$OUT; $OUT->autoflush(1); @prompt = $flags{ -prompt } if !@prompt and $flags{ -prompt }; my $IN; if ($flags{-tty} || $flags{-argv}) { open $IN, ($^O eq 'MSWin32' ) ? '<CON' : ">/dev/tty" or croak "Cannot read from terminal: $!"; }

    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      I noticed. The only test script is 00.load.t, which as its name implies only requires that the module be able to load.

      I plan on sending him a new test script named 01.dependencies.t
      use Test::More tests => 2; # Depends on hardcoded /dev/tty access ok( open(my $OUT, ">/dev/tty"), "Output to /dev/tty"); ok( open(my $IN, "</dev/tty"), "Input from /dev/tty");
      Any bet on whether or not he'll actually include it in the release?

      - Miller