Thanks a lot for your prompt reply, Damian.
Unfortunately, your sample produces the very same issue for me.
Attaching the screenshot.
OS: Win7x64
Perl: 5, version 24, subversion 0 (v5.24.0) built for
MSWin32-x64-multi-thread
Problem seems to be, that
# If input timed out insert the default, if any...
my $timedout = $in_pos == do{ no warnings; tell $in_filehandle } // 0;
if ($timedout && exists $opt_ref->{-def}) {
$input = $opt_ref->{-def};
$defaulted = 1;
}
sets $input to value of -default
Jan
On Mon, Jul 18, 2016 at 10:58 PM, damian@conway.org via RT <
bug-IO-Prompter@rt.cpan.org> wrote:
Show quoted text> <URL:
https://rt.cpan.org/Ticket/Display.html?id=116301 >
>
> Hi Jan,
>
> I'm sorry you're having trouble with the module.
>
> However I cannot replicate the problem your reporting
> under Perl 5.14, 5.20, or 5.24 on MacOSX.
>
> For example, this code:
>
> use IO::Prompter;
>
> while (1) {
> if ( prompt( "Do you want to do it?", -yesno, -stdio, -default =>
> 'y' ) ) {
> say '--> yes';
> }
> else {
> say '--> no';
> }
> }
>
> produces:
>
> Do you want to do it? y
> --> yes
> Do you want to do it? n
> --> no
> Do you want to do it? <return>
> --> yes
>
> as expected.
>
> What version of Perl and what OS are you using?
>
> Damian
>
>