On 2016-05-08 13:51:56, KENTNL wrote:
Show quoted text> Yeah, Its not obvious why its blocking without reading this bug first.
>
> I have cpanm set up to be interactive, but the actual prompt doesn't
> write to
> the interactive tty, it gets lost in the log.
>
> So all I see is a blocked terminal. Upon digging into the process with
> htop +
> strace, I see its blocking on "read", and indeed, pumping a return key
> into the
> attached terminal results in it working.
>
> ( And then my monitor which shows me the log contents when they're
> updated
> shows me the prompt message being fed into the log .... alas, they
> turn up
> *after* I pressed return ... )
Looking at
https://metacpan.org/source/JENDA/Mail-Sender-0.8.23/Config.PL#L18 the problems seems to be clear: the questions are printed to STDOUT, not STDERR. STDOUT is not flushed by default. Perl is usually smart enough to flush STDOUT automatically before a read from STDIN happens, but this does not always work.
So in short: the solution is to use "print STDERR" instead of "print" in the whole script.
Regards,
Slaven