in reply to IO::Prompter on Windows

I would guess that the most likely candidate is unix-centric newline handling of the input as read from the console. Depending on how it works on Windows resp. how Windows Perl treats stuff read from STDIN, you might end up with \r\n in your input. A (very) cursory glance at the source code of IO::Prompter only reveals \n newline treatment.

If you can fake input to IO::Prompter, or inspect the value of $_ for the -must callback, maybe you find some whitespace at the end of the (supposed) filename...

Replies are listed 'Best First'.
Re^2: IO::Prompter on Windows
by Brutha (Friar) on Nov 05, 2013 at 09:14 UTC

    Uaaah, the obvious thing.

    You are correct, every returned input has '\cM' appended, with the obvious exception of the menues.

    Thank You. Now I have a hint to continue.

    Edit:

    Looking at the code, the regex "/\A\R\z/" is used to identify the return key. Of course, this matches '\r'. Afterwards exactly this character is appended to the input and spoils enter-handling.

    As a quick hack, I modified Prompter.pm, line 1379, the following way:

    # Add newline to the accumulated input string... #$input .= $next; $input .= "\n";

    This seems to help me, but is a hack

    And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
    (Terry Pratchett, Small Gods)